Commit Graph

2815 Commits

Author SHA1 Message Date
Marius Strobl
7e543a0ed3 Make the VIA workaround actually do its intended job.
MFC after:	3 days
2012-05-26 08:31:12 +00:00
Alexander Motin
3dfe1a8e49 Fix for the r235558: interrupt output pipe is optional, so fix the driver
attach and operation when it is absent.

Sponsored by:	iXsystems, Inc.
MFC after:	1 week
2012-05-17 22:04:17 +00:00
Alexander Motin
3a38def3ed Add support for writing to HID devices through the interrupt output pipe.
Supermicro LCD screen modules seem to not support accessing reports through
the control pipes, but working fine with the interrupt pipes.

Sponsored by:	iXsystems, Inc.
MFC after:	1 week
2012-05-17 18:40:27 +00:00
Alexander Motin
cff79d9ed3 HID Report ID is unsigned value, so clear the rest of bits from possible
sign expansion.
2012-05-16 17:51:56 +00:00
Hans Petter Selasky
32e79f5540 Move reset of USB mouse parameters from the USB mouse attach to
the USB mouse device open. Protect against multi character
device open. Some other nits.

MFC after:	1 week
2012-05-14 17:00:32 +00:00
Marius Strobl
e4029d4cac - Change the module order of these MAC drivers to be last so they are
deterministically handled after the corresponding PHY drivers when
  loaded as modules. Otherwise, when these MAC/PHY driver pairs are
  compiled into a single module probing the PHY driver may fail. This
  makes r151438 and r226154 actually work. [1]
  Reported and tested by: yongari (fxp(4))
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

Submitted by:	jhb [1]
MFC after:	3 days
2012-05-11 02:40:40 +00:00
Hans Petter Selasky
7e66ab7cb6 Make sure the EHCI bandwidth allocation algorithm
for FULL speed SPLIT transactions works fully.

MFC after:	1 week
2012-05-03 16:06:22 +00:00
Hans Petter Selasky
0a4cc48fe5 Add support for Multi-TT mode of modern USB HUBs.
This will give you more bandwidth for isochronous
FULL speed applications connected through a
High Speed HUB.

This patch has been tested with XHCI and EHCI.

MFC after:	1 week
2012-04-29 17:12:33 +00:00
Kevin Lo
03167052c4 Add support for the SIMCom SIM5218, tested by me. 2012-04-21 14:30:51 +00:00
Thomas Quinot
4815449e08 Fix typo in comment 2012-04-18 12:50:13 +00:00
Hans Petter Selasky
6d917491f5 Fix compiler warnings, mostly signed issues,
when USB modules are compiled with WARNS=9.

MFC after:	1 weeks
2012-04-02 10:50:42 +00:00
Hans Petter Selasky
4563ba7a0d Add definitions and structures for USB 2.0 Link Power Management, LPM.
MFC after:	2 weeks
2012-04-02 07:51:30 +00:00
Bernhard Schmidt
f9d032660b Load the firmware during init not attach, as a root filesystem might
not yet be available. While here, also print the firmware version.

Submitted by:	PseudoCylon
MFC after:	3 days
2012-03-21 19:08:44 +00:00
Hans Petter Selasky
b733be57cc Add new USB device IDs.
PR:		usb/165815
MFC after:	1 week
2012-03-08 07:22:41 +00:00
Hans Petter Selasky
0b8de86913 Fix for DWC OTG interrupt register programming.
Fix a compiler warning.
Add missing header file.

MFC after:	1 week
2012-03-05 06:41:44 +00:00
Hans Petter Selasky
02f728afc9 Make sure that the USB system suspend event is executed synchronously
and not asynchronously. This fixes problems related to USB system
suspend and resume.  It is assumed that we are always allowed to sleep
from the device_suspend() method.

MFC after:	1 week
Submitted by:	jkim
2012-03-03 08:11:04 +00:00
Hans Petter Selasky
0e03919dc4 Style change: Expand redundant #if's. Remove a couple of empty lines.
MFC after:	1 week
2012-03-01 20:25:17 +00:00
Hans Petter Selasky
335dd8f82f Close a detach race. Make sure all pending
CCB's get canceled at device detach.

MFC after:	1 week
2012-03-01 20:10:54 +00:00
Kevin Lo
d4d6dcc5bb Add support for the MCS7832
Obtained from:	OpenBSD
2012-02-28 15:45:42 +00:00
Hans Petter Selasky
a40c00a535 Add new USB device ID.
MFC after:	3 days
PR:		usb/165154
2012-02-14 21:36:55 +00:00
Ed Schouten
7870adb640 Remove direct access to si_name.
Code should just use the devtoname() function to obtain the name of a
character device. Also add const keywords to pieces of code that need it
to build properly.

MFC after:	2 weeks
2012-02-10 12:35:57 +00:00
Attilio Rao
5d7380f8e3 Avoid to check the same cache line/variable from all the locking
primitives by breaking stop_scheduler into a per-thread variable.
Also, store the new td_stopsched very close to td_*locks members as
they will be accessed mostly in the same codepaths as td_stopsched and
this results in avoiding a further cache-line pollution, possibly.

STOP_SCHEDULER() was pondered to use a new 'thread' argument, in order to
take advantage of already cached curthread, but in the end there should
not really be a performance benefit, while introducing a KPI breakage.

In collabouration with:	flo
Reviewed by:	avg
MFC after:	3 months (or never)
X-MFC:		r228424
2012-01-28 14:00:21 +00:00
Hans Petter Selasky
dd03e19c08 Add support for the DesignWare USB 2.0 OTG controller chipset.
Currently the code is not built by any modules. That will
be fixed later. The Atmel ARM bus interface file part of this
commit is just for sake of example. All registers and bits are
declared like macros and not C-structures like in official
Synopsis header files. This driver mostly origins from the
musb_otg.c driver in FreeBSD except that the chip specific
programming has been replaced by the one for DWC 2.0 USB OTG.
Some parts related to system suspend and resume have been left
like empty functions for the future. USB suspend and resume is
fully supported.
2012-01-21 13:31:38 +00:00
Hans Petter Selasky
6f0e06a10e Add support for new USB device.
PR:		usb/164275
MFC after:	3 days
2012-01-19 18:03:52 +00:00
Stanislav Sedov
f6d505ea58 - Add ID for the BeagleBone FTDI serial over usb port.
MFC after:	3 days
2012-01-16 23:14:23 +00:00
Hans Petter Selasky
36dc69c414 Add support for more USB devices.
Submitted by:	pav @
MFC after:	1 week
2012-01-16 22:26:25 +00:00
Hans Petter Selasky
96d87d2b69 Export ttyname instead of ttyunit via the sysctl interface.
Submitted by:	Mykhaylo Yehorov
PR:		usb/164090
MFC after:	1 week
2012-01-16 10:42:43 +00:00
Hans Petter Selasky
3a4a1a7f8a Export information about USB serial port unit and port numbers
directly via the sysctl interface.

Submitted by:	Mykhaylo Yehorov
PR:		usb/164090
MFC after:	1 week
2012-01-16 08:13:25 +00:00
Tim Kientzle
79ca35f323 BeagleBone uses an FTDI chip with
an altered Product ID.
2012-01-15 23:00:33 +00:00
Ulrich Spörlein
9a14aa017b Convert files to UTF-8 2012-01-15 13:23:18 +00:00
Hans Petter Selasky
93ee6e858b Improve support for USB 3.0 HUBs. In certain states we
should do a warm reset instead of the default reset.

MFC after:	5 days
2012-01-13 22:26:13 +00:00
Hans Petter Selasky
e02f894bbe Bugfix: Make sure the XHCI driver doesn't clear
the route string field. Else USB 3.0 HUBs
won't work.

MFC after:	5 days
2012-01-13 22:19:14 +00:00
Hans Petter Selasky
99b0e60766 Correct use of USB 3.0 POWER bit in the port status register,
hence it was overlapping the USB 3.0 root HUB's speed bits.

Reported by:	Kohji Okuno
MFC after:	1 week
2012-01-13 07:28:34 +00:00
Hans Petter Selasky
4131f6fb60 - Try to fix support for USB 3.0 HUBs.
- Try to fix support for USB 3.0 suspend and resume.

MFC after:	1 week
2012-01-12 21:21:20 +00:00
Kevin Lo
5bbe0c5357 ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again
Reviewed by:	yongari
2012-01-07 09:41:57 +00:00
Hans Petter Selasky
6bbe7cdfb2 Make sure we probe and attach the root HUB after
resume else no devices will appear again.

MFC after:	1 day
2012-01-02 20:28:33 +00:00
Hans Petter Selasky
c2d0465a9b Add missing change to XHCI driver similar to changes in r228483.
MFC after:	0 days
2011-12-31 13:34:42 +00:00
Oleksandr Tymoshenko
d42cc94633 - Enable usbus on octusb 2011-12-24 00:22:21 +00:00
Andriy Gapon
bc40a96992 ukbd: adjust for SCHEDULER_STOPPED() and overhaul locking code
This change is designed to let USB keyboard work in the panic context
with stop_scheduler_on_panic=1.  Most of change consists of removing
mtx_owned() checks where they can be easily avoided.  Some additional
lock cleanup is performed along the way.

A list of the smaller changes:
- newbus methods should be executed with Giant already held, just assert
  this
- kbd methods called in the non-polling context should be executed with
  Giant already held, just assert this
- Giant is recursive, so we should just take it where we must have it,
  without redundant checks if we already have it
- thanks to recent syscons changes we don't need to go through the hoops
  to detect if kernel is going to poll us; polling mode is now clearly
  separated from non-polling mode
- at present the polling mode can be entered by only one thread
- document special cases in greater detail

Please note that the ukbd code and underlying USB code still lve
dangerously in the kdb context by trying to obtain various locks
including the Giant.  If any of those locks are already held by the
stopped threads, then the things would blow up.
Another limitation of the ukbd driver is that it is detached before a
system enters the halt state.

With this commit we can enable kern.stop_scheduler_on_panic by default,
that should not introduce any regressions.

Reviewed by:	hselasky
MFC after:	3 months
X-MFC after:	r228424, r228760
2011-12-21 11:49:33 +00:00
Andriy Gapon
6703915ee7 adapt usb transfer code for SCHEDULER_STOPPED
When SCHEDULER_STOPPED() is true the mtx_owned() call may return
an unexpected and thus meaningless result.
So, in the code paths that can be reached when SCHEDULER_STOPPED() is true
we need to protect the mtx_owned() calls with the SCHEDULER_STOPPED()
checks and ensure that an appropriate branch is taken in each case.

Reviewed by:	hselasky
MFC after:	3 months
X-MFC after:	r228424
2011-12-21 10:52:17 +00:00
Hans Petter Selasky
85b44a018c Fix for race against user-space applications trying to change the
configuration on USB HUBs.

PR:		kern/163091
MFC after:	1 week
2011-12-21 08:46:08 +00:00
Hans Petter Selasky
d63cc02d7a Make the recently added "no_shutdown_wait" sysctl writeable.
Suggested by:	avg @
MFC after:	3 days
2011-12-19 23:39:08 +00:00
Hans Petter Selasky
5ed294aec0 Add code to wait for USB shutdown to be executed at system shutdown.
Add sysctl which can be used to skip this waiting.

MFC after:	3 days
2011-12-19 15:35:05 +00:00
Hans Petter Selasky
6bd3e53514 Add missing unlock of USB controller's lock, when
doing shutdown, suspend and resume.

Suggested by:	avg @
MFC after:	3 days
2011-12-19 14:53:42 +00:00
Kevin Lo
0022629fe0 Another axe(4), found in ASUS zenbook. 2011-12-17 15:38:16 +00:00
Andriy Gapon
9976156f12 kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.

Current intended meaning of the calls is that the kernel takes control of
console input.  In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).

Inspired by:	bde
MFC after:	2 months
2011-12-17 15:08:43 +00:00
Bernhard Schmidt
fcd9500f91 Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
  compiler warnings

Submitted by:	arundel@
2011-12-17 10:23:17 +00:00
Hans Petter Selasky
58a1ff3bf4 Improve fix for random USB transfer time out.
Suggested by:	YougHyeon
MFC after:	3 days
2011-12-14 22:14:05 +00:00
Hans Petter Selasky
663e39b0b5 Fix for random USB transfer time out.
Submitted by:	PseudoCylon
MFC after:	3 days
2011-12-14 08:52:27 +00:00
Hans Petter Selasky
5f63a5d203 Fix definition of XHCI port power bit.
Reported by:	Kohji Okuno
MFC after:	3 days
2011-12-14 08:44:16 +00:00