Commit Graph

28438 Commits

Author SHA1 Message Date
Ruslan Bukin
d69eefebd2 o Restore 'goto tr_setup;' when operating in host mode mistakenly
removed in r277414.
o Remove extra parentheses around cases.
2015-01-20 16:30:02 +00:00
Ruslan Bukin
7d502f3285 o Do notify USB host each time we receive 'set packet filter' request.
This makes Mac OS X happy when it returns back from suspending.
o Switch notify state after data is transferred, but not before.
o Consider there is also Super Speed mode.
o Do not set stall bit on any pipes in device mode as Mac OS X seems
  don't support it.

In collaboration with:	hselasky@
2015-01-20 15:45:09 +00:00
Hans Petter Selasky
84e3f97e6d Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
the value returned in the "udp_port_level" field.

Reported by:	Uffe Jakobsen <uffe@uffe.org>
MFC after:	1 week
2015-01-20 11:43:16 +00:00
Ganbold Tsagaankhuu
e2763dca83 Enable Synopsys DesignWare Mobile Storage Host Controller
driver on Rockchip boards. It currently supports PIO mode
and dma mode needs external dma controller to be used.

Submitted by:   jmcneill
Approved by:    stas (mentor)
2015-01-20 09:07:28 +00:00
Hans Petter Selasky
d39d7c8636 Add missing linuxapi module dependencies and always use the FreeBSD
"MODULE_VERSION" macro definition. Remove the redefinition of the
"MODULE_VERSION" macro from the Linux kernel compatibility API.

MFC after:	1 month
Reported by:	np@
Sponsored by:	Mellanox Technologies
2015-01-19 21:53:00 +00:00
Andrew Turner
09eb425a04 Make the clock-frequency property optional as it may not be present on FDT
systems.

Sponsored by:	The FreeBSD Foundation
2015-01-19 11:06:56 +00:00
Adrian Chadd
b2bdc62a95 Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific
bits.

The motivation here is to eventually teach netisr and potentially
other networking subsystems a bit more about how RSS work queues / buckets
are configured so things have a hope of auto-configuring in the future.

* net/rss_config.[ch] takes care of the generic bits for doing
  configuration, hash function selection, etc;
* topelitz.[ch] is now in net/ rather than netinet/;
* (and would be in libkern if it didn't directly include RSS_KEYSIZE;
  that's a later thing to fix up.)
* netinet/in_rss.[ch] now just contains the IPv4 specific methods;
* and netinet/in6_rss.[ch] now just contains the IPv6 specific methods.

This should have no functional impact on anyone currently using
the RSS support.

Differential Revision:	D1383
Reviewed by:	gnn, jfv (intel driver bits)
2015-01-18 18:06:40 +00:00
Colin Percival
633a28478c When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
accidentally enable non-existent states.

This bug was triggered if ACPI advertises the presence of a C2 state
which we fail to parse via acpi_PkgGas due to our lack of support for
FFixedHW resources, and causes an immediate panic when an attempt is
made to enter the (NULL) state.

One affected platform is the EC2 c4.8xlarge VM instance type; there
may be others.

MFC after:	1 week
Thanks to:	jkim, @_msw_
2015-01-18 12:45:26 +00:00
Justin Hibbits
59bb84753c Use proper signed types. The ADT746x uses signed 8-bit numbers for the
temperature.

MFC after:	2 weeks
2015-01-18 07:08:06 +00:00
Ian Lepore
bba987dc50 Add a new SDHCI quirk, SDHCI_QUIRK_DONT_SET_HISPD_BIT. Apparently some
sdhci controllers, such as the one on a Raspberry Pi, mishandle the signal
timing in high speed signaling mode, but run just fine in standard mode
with the bus running at frequencies between 25-50MHz (which shouldn't work).

This is the solution adopted by U-Boot and other OSes (linux and *BSD)
for the timeouts on Raspberry Pi boards with certain SD cards.  Some
research shows that this quirk is also used on a few other boards, so the
fix is a generic quirk instead of being in the RPi-specific driver code.

This change is based on information discovered by Michal Meloun.
2015-01-17 19:57:03 +00:00
Ian Lepore
cf5bb7ca1c Add defines for SDHCI 3.0 controllers.
Submitted by:	Michal Meloun <meloun@miracle.cz>
2015-01-17 18:56:22 +00:00
Ruslan Bukin
b0b74fb366 o Notify USB host about connection when operating in device mode.
Required when communicating to Mac OS X USB host stack.
o Also don't set stall bit to TX pipe in device mode as seems Mac OS X
  don't clears it as it should.

Discussed with:	hselasky@
2015-01-17 12:31:26 +00:00
Adrian Chadd
30696562d3 Oops; correctly reload the CCA registers with the uncapped value
in prep for the next NF calibration pass.

Totally missing braces.  Damn you C.

Submitted by:	Sascha Wildner <swildner@dragonflybsd.org>
MFC after:	1 week
2015-01-17 07:33:02 +00:00
Nathan Whitehorn
d2d3e9b818 Return an appropriate error code in the case of a missing property rather
than random numbers.

MFC after:	1 week
2015-01-17 07:01:51 +00:00
Adrian Chadd
e21928d3c3 Until there's a full MCI implementation - just implement a placeholder
MCI bluetooth coexistence method for WB222.

The rest of MCI requires a bunch more work, including adding a DMA buffer
for the MCI hardware to bounce messages in/out of and handling MCI
interrupts.  But the more important part here is telling the HAL
the btcoex is enabled and MCI is in use so it configures the correct
initial bluetooth parameters in the wireless NIC and configures
things like bluetooth traffic weights and such.

So, this at least gets the HAL to do some of the right things in
configuring the inital bluetooth coexistence stuff, but doesn't
actually do full btcoex.  That'll take.. some effort.

Tested:

* AR9462 (WB222), STA mode
2015-01-17 00:02:18 +00:00
Adrian Chadd
335b1a6beb Add bluetooth MCI coexistence HAL methods - used for AR9462 and AR9565 NICs.
It's found, amongst other things, in the Acer Chromebook (Intel)
devices.

Tested:

* AR9462 (WB222)

Obtained from:	Qualcomm Atheros
2015-01-16 23:47:42 +00:00
Jack F Vogel
dcd7b3b269 Some RSS issues discovered by Adrian, missing header, variable
names fat fingered, incorrect hash config setup. Thanks :)

MFC after: 1 week
2015-01-16 19:11:58 +00:00
Nathan Whitehorn
c884d31122 Add two fake properties ("fdtbootcpu" and "fdtmemreserv") to the device
tree's /chosen node to provide out-of-band header fields of the FDT. This
emulation is not perfect without corresponding changes to ofw_fdt_nextprop(),
but is enough to enable lookup by memory-map-parsing code.

MFC after:	1 week
2015-01-16 18:47:20 +00:00
Hans Petter Selasky
c8563d530c Add more USB device IDs.
Submitted by:	max.n.boyarov@gmail.com
PR:		196362
MFC after:	1 week
2015-01-16 12:16:21 +00:00
Warner Losh
966e729842 Always enable I/O, memory and dma cycles. Some BIOSes don't enable
them, sometimes they are reset for power state transitions or during
whatever happens while suspended. Also, it is good practice to always
do this.
2015-01-16 06:19:52 +00:00
Warner Losh
53d673996b Move the suspsned and resume functions to the bus attachment. They
were accessing PCI config registers, which won't work for the ISA
version.
2015-01-16 06:19:39 +00:00
Warner Losh
47a66ea835 Suspend and resume were the only two functions not to follow the brdev
convention here, so fix that.
2015-01-16 06:19:24 +00:00
Warner Losh
b45c7d14d0 Back out the refactor. It turns out to cause interrupt storms on
resume sometimes (but not others). On powerup, other wierd issues show
up (sometimes the card comes up, but with really bogus pci config
space stuff. There may be more, but given my experience of historical
fussiness, stick to what works and make more minimal changes to that.
2015-01-16 06:19:08 +00:00
Adrian Chadd
3b48f36ef6 Check the right value correctly.
Thanks to clang for pointing out this silliness.
2015-01-16 01:52:26 +00:00
Navdeep Parhar
88d7f6bddf Allow cxgbe(4) to be built on i386. Driver attach will succeed only on a subset
of i386 systems.
2015-01-16 01:32:40 +00:00
Baptiste Daroussin
6455cdfb29 Sound: fix typos in user visible messages etc.
Submitted by:	Sascha Wildner <saw@online.de>
Obtained from:	DragonFly
MFC after:	3 days
2015-01-15 16:09:35 +00:00
Hans Petter Selasky
07dbde6777 Add a kernel function to delist our kernel character devices, so that
the device name can be re-used right away in case we are destroying
the character devices in the background.

MFC after:	4 days
Reported by:	dchagin@
2015-01-14 14:04:29 +00:00
Randall Stewart
d95b3509e1 Update the hwpmc driver to have the new type HASWELL_XEON. Also
go back through HASWELL, IVY_BRIDGE, IVY_BRIDGE_XEON and SANDY_BRIDGE
to straighten out all the missing PMCs. We also add a new pmc tool
pmcstudy, this allows one to run the various formulas from
the documents "Using Intel Vtune Amplifier XE on XXX Generation platforms" for
IB/SB and Haswell. The tool also allows one to postulate your own
formulas with any of the various PMC's. At some point I will enahance
this to work with Brendan Gregg's flame-graphs so we can flamegraph
various PMC interactions. Note the manual page also needs some
work (lots of work) but gnn has committed to help me with that ;-)
Reviewed by: gnn
MFC after:1 month
Sponsored by:	Netflix Inc.
2015-01-14 12:46:58 +00:00
Gleb Smirnoff
501b391d56 Clean some dead code. 2015-01-14 12:46:38 +00:00
Warner Losh
8b91d5b008 Various interrelated fixes to make suspend / resume work better. We now
can suspend / resume and unload / load cbb and cardbus without errors
on my Lenovo T400, which wasn't possible before. Cards suspending
and resuming in the CardBus slot not yet tested.
o Enable memory cycles to the bridge early (as part of the new
  cbb_pci_bridge_init). This fixes the Bad VCC errors which were
  caused by the code accessing the device registers with this
  cleared. The suspend / resume process clears it.
o Refactor suspend / resume into bus specific code (though the ISA
  code is just stubbed). This isn't strictly necessary, but makes
  the initializaiton code more uniform and should be more bullet
  proof in the face of variant behavior among cardbus bridges.
o Fixup comments in the power-up sequence to reflect reality. These
  comments were written for one regime of power-up, but not updated
  as things were revised.
o Add a paranoid small delay (100ms) to cover noisy cards powering
  down.
o Fix some debugging prints to be easier to grep from dmesg.

Sponsored by: Netflix
2015-01-14 05:41:33 +00:00
Warner Losh
8bf007e1e6 Add a rather obnoxious warning if you don't have NEW_PCIB defined
since it's a total crap shoot if things will work.
2015-01-14 05:41:31 +00:00
Jack F Vogel
df1d7a71d4 Cleanup some bogus code in the RSS config, and add the include
for the rss option file. And bump the version.

MFC after:	1 week
2015-01-13 22:13:30 +00:00
Jack F Vogel
6b30e6ae6c Complete the RX side RSS code: parse the encoded portion of the RX
descriptor to determine the correct hash type.

MFC after:1 week
2015-01-13 18:56:29 +00:00
Hans Petter Selasky
b78e84d132 Resolve a special case deadlock: When two or more threads are
simultaneously detaching kernel drivers on the same USB device we can
get stuck in the "usb_wait_pending_ref_locked()" function because the
conditions needed for allowing detach are not met. The "destroy_dev()"
function waits for all system calls involving the given character
device to return. Character device system calls may lock the USB
enumeration lock, which is also held when "destroy_dev()" is
called. This can sometimes lead to a deadlock not noticed by
WITNESS. The current solution is to ensure the calling thread is the
only one holding the USB enumeration lock and prevent other threads
from getting refs while a USB device detach is ongoing. This turned
out not to be sufficient. To solve this deadlock we could use
"destroy_dev_sched()" to schedule the device destruction in the
background, but then we don't know when it is safe to free() the
private data of the character device. Instead a callback function is
executed by the USB explore process to kill off any leftover USB
character devices synchronously after the USB device explore code is
finished and the USB enumeration lock is no longer locked. This makes
porting easier and also ensures us that character devices must
eventually go away after a USB device detach.

While at it ensure that "flag_iserror" is only written when "priv_mtx"
is locked, which is protecting it.

MFC after:	5 days
2015-01-13 16:37:43 +00:00
Navdeep Parhar
e503548810 cxgbe/iw_cxgbe: fix whitespace nit in r277102.
Reported by:	stefanf@
2015-01-13 16:18:31 +00:00
Ruslan Bukin
eff43c7467 Rename Exynos UART driver. No functional change.
Submitted by:	Michal Meloun <meloun@miracle.cz>
2015-01-13 15:04:28 +00:00
Bjoern A. Zeeb
a2cf30b916 Move the vsi variable outside of the #ifdef block to unbreak NOIP kernels
after r277084.

MFC after:	6 days
X-MFC with:	r277084
2015-01-13 14:15:00 +00:00
Ruslan Bukin
3e420a3e12 Add usb template SERIALNET allowing us to have both USB CDC Ethernet
and USB CDC Modem same time by single cable.

Reviewed by:	hselasky@
2015-01-13 14:03:56 +00:00
Konstantin Belousov
43d5c9f65a Complete r277100: add AHCI_Q_ABAR0 tp AHCI_Q_BIT_STRING.
Noted and reviewed by:	smh
MFC after:	6 days
2015-01-13 09:50:15 +00:00
Gleb Smirnoff
9ff0137ec1 Remove unused variables.
CID:	1262431
CID:	1262430
2015-01-13 06:56:04 +00:00
Gleb Smirnoff
01f3b262c4 - Remove unused variable.
- Wrap long line.
2015-01-13 06:22:55 +00:00
Gleb Smirnoff
22064c8f39 Remove unused fields. 2015-01-13 06:22:24 +00:00
Xin LI
25baf019f1 Use the common codepath to handle SIOCGIFADDR.
Before this change, the current code handles SIOCGIFADDR the same
way with SIOCSIFADDR, which involves full arp_ifinit, et al.  They
should be unnecessary for SIOCGIFADDR case.

Differential Revision: https://reviews.freebsd.org/D1508
Reviewed by:	glebius
MFC after:	2 weeks
2015-01-13 05:32:51 +00:00
Navdeep Parhar
b3e112f962 cxgbe/iw_cxgbe: allow any size during the initial MPA exchange.
MFC after:	1 month
2015-01-13 01:40:12 +00:00
Konstantin Belousov
378c532c1f Add quirk to override default BAR(5) rid for AHCI.
Use it for Cavium AHCI.

Submitted by:	Michaе┌ Stanek
Reviewed by:	imp (previous version)
MFC after:	1 week
2015-01-13 00:11:56 +00:00
Zbigniew Bodek
4b3d916086 Introduce ofw_bus_reg_to_rl() to replace part of common bus code
Instead of reusing the same reg parsing code, create one, common function
that puts reg contents to the resource list. Address cells and size cells
are passed rather than acquired here so that any bus can have different
default values.

Obtained from:   Semihalf
Reviewed by:     andrew, ian, nwhitehorn
Sponsored by:    The FreeBSD Foundation
2015-01-13 00:00:09 +00:00
Gleb Smirnoff
7e310d2d50 In miibus(4) drivers provide functions that allow to get NIC
driver name and NIC driver softc via the device(9) tree,
instead of going dirty through the ifnet(9) layer.

Differential Revision:	D1506
Reviewed by:		imp, jhb
2015-01-12 22:27:38 +00:00
Jack F Vogel
845a028fa3 Missing RSS support added, this fixes the build, but the code
in the RX side was complicated by recent changes and will need
some further tweaking.
2015-01-12 20:59:07 +00:00
Jack F Vogel
393c4bb1ba Intel I40E driver updates:
if_ixl to version 1.3.0, if_ixlv to version 1.2.0
	- Major change in both drivers is to add RSS support
	- In ixl fix some interface speed related issues, dual
	  speed was not changing correctly, KR/X media was not
	  displaying correctly (this has a workaround until a
	  more robust media handling is in place)
	- Add a warning when using Dell NPAR and the speed is
	  less than 10G
	- Wrap a queue hung message in IXL_DEBUG, as it is non-fatal,
	  and without tuning can display excessively

MFC after: 1 week
2015-01-12 18:43:34 +00:00
Jack F Vogel
f247dc2523 Update to the shared code for Intel I40E drivers in preparation
for the ixl 1.3.0 and ixlv 1.2.0 revisions.

MFC after:	1 week
2015-01-12 18:32:45 +00:00