Commit Graph

3048 Commits

Author SHA1 Message Date
Hans Petter Selasky
46902503bc Add some USB gadget example drivers for USB audio, USB keyboard,
USB mouse and USB modem classes. Hopefully someone will find
these examples useful when implementing USB device side drivers
using the FreeBSD USB stack.
2013-07-22 13:39:33 +00:00
Hans Petter Selasky
25cedb6f51 Fix an XHCI regression:
The Block Event Interrupts, BEI, feature does not
work like expected with the Renesas XHCI chipsets.
Revert feature.

While at it correct the TD SIZE computation in
case of Zero Length Packet, ZLP, in the end of a
multi frame USB transfer.

MFC after:	1 week
PR:		usb/180726
2013-07-21 20:45:23 +00:00
Navdeep Parhar
b564fe858c There's nothing to free if the unit wasn't allocated. 2013-07-19 21:54:48 +00:00
Konstantin Belousov
31b67ab26e Add a tunable to force disable MSI use for xhci(4).
Requested and tested by:	delphij
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2013-07-16 20:14:23 +00:00
Rui Paulo
fc4153c26f Revert r252725 as it breaks WPA.
We need to fix wpa_supplicant because it checks whether the card has
ic_cryptocaps set. Since net80211 can do software encryption this check in
wpa_supplicant is wrong.
2013-07-14 18:26:47 +00:00
Hans Petter Selasky
0ccd2fb09e Allow regular off-the-shelf keyboards to be overclocked like so-called
"Gamers Keyboards" by adding a tunable, "hw.usb.ukbd.pollrate", which
can fix the polling rate of the attached USB keyboards in the range
1..1000Hz. A similar feature already exists in the USB mouse
driver. Use with care! Might leave you without keyboard input. This
feature is only available when the USB_DEBUG option is set in the
kernel configuration file.

Correct "unit" type to "int" while at it.
2013-07-13 22:39:56 +00:00
Hiren Panchasara
3c9d5a037d Adding urtwn(4) firmware and related changes.
Reviewed by:	rpaulo
Approved by:	sbruno (mentor)
2013-07-10 08:21:09 +00:00
Konstantin Belousov
89d02670ab Use MSI for xhci(4), if supported.
Reviewed by:	jhb
Tested by:	dchagin
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-07-09 12:55:01 +00:00
Oleksandr Tymoshenko
860e12e971 - Add initial host mode support for Mentor Graphics USB OTG controller
- Sync musb_otg_atmelarm with new core logic API
2013-07-07 04:18:35 +00:00
Rui Paulo
2173825bac Set ic_cryptocaps to make sure wpa_supplicant works with WEP. 2013-07-04 20:57:15 +00:00
Hiroki Sato
52d5f34490 Add Planex MZK-UE150N.
Submitted by:	Yusuke Tanaka
MFC after:	3 days
2013-07-02 07:35:57 +00:00
Rui Paulo
a5dcb0640f Add RealTek 8192SU product IDs. 2013-07-02 06:49:05 +00:00
Rui Paulo
efb6af5c24 Fix a typo. 2013-06-30 06:05:32 +00:00
Rui Paulo
d718126e58 Fix the RSSI calculation. 2013-06-30 06:04:00 +00:00
Rui Paulo
bd3d8bed6c Fix the ni_txrate calculation. 2013-06-30 05:25:24 +00:00
Rui Paulo
fd57292555 Fix a reference count bug in urtwn_ra_init(). 2013-06-30 05:10:33 +00:00
Remko Lodder
c68a57b8f6 Add support for the NTT Docomo L-02C card.
(This file didn't get along in the previous commit)

PR:		180017
Submitted by:	Masaharu FUJITA
Glanced at by:	imp
MFC after:	1 week
2013-06-27 09:08:07 +00:00
Remko Lodder
80196fbd91 Add support for the NTT Docomo L-02C card.
PR:		180017
Submitted by:	Masaharu FUJITA
Glanced at by:	imp
MFC after:	1 week
2013-06-27 09:06:00 +00:00
Kevin Lo
1d02cf7c8d Add support for D-Link DWA-131. 2013-06-25 06:43:04 +00:00
Pyun YongHyeon
7008404ddd Add Lenovo USB 2.0 Ethernet adapter.
PR:		usb/179920
MFC After:	1 week
2013-06-25 00:26:30 +00:00
Pyun YongHyeon
fec40c2d03 When RX checksum offloading is active, AX88772B will prepend a
checksum header.  The header contains a received frame length but
the defined length for AX88772B is different with other ASIX
controllers.  When the RX checksum is off, AX88772B controller does
not prepend a checksum header so driver has to use normal header
length mask.
This change should fix RX errors when RX checksum offloading is
off.

Tested by:	kevlo
MFC After:	1 week
2013-06-24 05:18:31 +00:00
Thomas Quinot
73ecbbb39c Revert previous change to uark.c (restore previous rev), which was
committed by mistake.
2013-06-23 20:22:49 +00:00
Thomas Quinot
9aa5c929ba Fix minor typo in comment 2013-06-23 20:19:51 +00:00
Kevin Lo
ebe0102309 - Use the consistenly PHY-specific reset routine PHY_RESET() rather than
generic mii_phy_reset().
- Return the result of mii_mediachg() rather than blindly returning 0.
- on smsc(4), driver lock should be held to get current
  mii_media_active/mii_media_status value.

Reviewed by:	yongari
2013-06-14 05:36:47 +00:00
Kevin Lo
85edd2e8f9 Remove unused variable sc_tx_bufsz.
The variable is initialized but not used.

Reviewed by:	yongari
2013-06-13 05:46:19 +00:00
Kevin Lo
f08b3a501a Fix a typo: s/KLSI/CATC/ 2013-06-13 01:33:01 +00:00
Rui Paulo
71c50b9ef2 Use STRUCT_USB_HOST_ID to make sure we have the right ELF section. 2013-06-10 05:45:16 +00:00
Rui Paulo
c2c2fc4d86 Import Kevin Lo's port of urtwn(4) from OpenBSD. urtwn(4) is a driver for the
Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless cards.
This driver requires microcode which is available in FreeBSD ports:
net/urtwn-firmware-kmod.

Hiren ported the urtwn(4) man page from OpenBSD and Glen just commited a port
for the firmware.

TODO:
- 802.11n support
- Stability fixes - the driver can sustain lots of traffic but has trouble
coping with simultaneous iperf sessions.
- fix debugging

MFC after:	2 months
Tested by:	kevlo, hiren, gjb
2013-06-08 16:02:31 +00:00
Hans Petter Selasky
d5d96494f8 Fix some recent regression issues:
1) Only multi-TD isochronous transfers should use NORMAL
type after specific type as per XHCI specification.

2) BEI bit is only available in NORMAL and ISOCHRONOUS
TRB types. Don't use this bit for other types to avoid
hardware asserts. Reserved bits should be don't care
though ...

MFC after:	1 week
PR:		usb/179342
2013-06-07 22:35:58 +00:00
Hans Petter Selasky
97d729cf33 Add support for polling the XHCI interrupt handler when
the regular interrupt handler is not working properly or
in case of MSI interrupts which are not yet supported.
Remove interrupt setup code for FreeBSD versions older
than 700031.

MFC after:	1 week
PR:		usb/179342
2013-06-07 14:30:06 +00:00
Hiren Panchasara
15e45369fe Fixing a typo.
Approved by:	sbruno (mentor)
MFC after:	3 days
2013-06-03 22:22:53 +00:00
Hans Petter Selasky
e45547006e Correct the TD size computation. npkt should reflect the number of packets
remaining after the current TRB has been executed. Refer to section 4.11.2.4
of the XHCI specification for USB.

MFC after:	1 week
2013-06-02 12:28:29 +00:00
Hans Petter Selasky
c82b624fdc Correct TRB type for multi TRB transfers of non-NORMAL type, like isochronous.
Only the first TRB should be markes as special. Subsequent ones should be
marked as NORMAL. Optimise away TD first variable.

MFC after:	1 week
2013-06-02 12:16:58 +00:00
Hans Petter Selasky
fc66305366 Use the correct constant for 8000 IRQ/s.
MFC after:	1 week
2013-06-02 12:00:16 +00:00
Hans Petter Selasky
60decf203d Block event interrupts when we don't need it as soon as possible.
Typically this feature is used for isochronous transfers.
This reduces the amount of XHCI interrupting.

MFC after:	1 week
2013-06-02 11:58:31 +00:00
Hans Petter Selasky
ef32af2180 Don't set the start ISOC ASAP bit for non-isochronous TRBs.
MFC after:	1 week
2013-06-02 10:54:47 +00:00
Hans Petter Selasky
cfa00b0d75 Correct some XHCI streams mode transfer handling found by code inspection.
The existing streams mode support is not working and has not been tested
due to lack of hardware which supports the given feature.

MFC after:	1 week
2013-06-02 10:32:57 +00:00
Eitan Adler
8753048d82 Add support for tethering on the iPhone 4S
PR:	usb/179078
Submitted by:	Christopher Sean Hilton <chris@vindaloo.com>
MFC After:	1 week
2013-05-29 20:36:51 +00:00
Hans Petter Selasky
8c93cb8131 Revert r251023 until a more proper solution is found
for ATI based USB controllers.

MFC after:	1 week
2013-05-28 18:51:30 +00:00
Hans Petter Selasky
6e7bc5b60d Workaround for for a problem seen with ATI Technologies EHCI
controller hardware most likely present on UHCI chipsets aswell. The
bug manifests itself when issuing isochronous transfers and bulk
transfers towards the same device simultaneously. From time to time it
happens that either the completion IRQ was missing or that the
completion IRQ was happening before the ITD/SITD was completely
written back to memory. The workaround assumes that double buffered
isochronous transfers are used, and that a second interrupt is
generated at the beginning of the next isochronous transfer to
complete the previous one. Possibly skipping the interrupt at the last
isochronous frame is possible, but will then break single buffered
isochronous transfers. For now we can live with some extra interrupts.

MFC after:	1 week
2013-05-27 06:32:07 +00:00
Hans Petter Selasky
273c749c93 Fix some statical clang analyzer warnings. 2013-05-25 17:09:58 +00:00
Hans Petter Selasky
6d5ae34a44 Add new USB quirk.
MFC after:	1 week
PR:		usb/178771
2013-05-21 06:13:38 +00:00
Warner Losh
8b18cb1c23 For ARM, MIPS, and PowerPC, default to 32-byte alignment, but allow it
to be as small as 8.
2013-05-17 20:53:15 +00:00
Gavin Atkinson
1c6951aeb6 o Retrive the part number (CP2103 etc) from the hardware on attach.
o  The CP2101 and CP2102 do not support GPIO pin use at all, enforce this.
o  Support reading the GPIO status on the second port of the CP2105.  More
   work is needed before the CP2105 GPIO pins can be used as outputs.

Hardware donated by:	Silicon Labs
MFC after:		3 weeks
2013-05-17 19:13:31 +00:00
Eitan Adler
a164074fc4 Fix several typos
PR:		kern/176054
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
MFC after:	3 days
2013-05-12 16:43:26 +00:00
Hans Petter Selasky
6c21893360 Fix compile warning. 2013-05-03 13:33:36 +00:00
Hans Petter Selasky
2c79a775ed - Add more defines to limit USB memory usage and number of allocations
in reduced memory systems.

- Split allocation and freeing of the configuration descriptor into a separate
function, so that the configuration descriptor can be made fixed size
to save memory allocations. This applies for both device and host mode.
2013-05-03 11:10:04 +00:00
Hans Petter Selasky
6a4dd49e2c Always put space before the comma before ##__VA_ARGS__ due to subtle compiler
differences.
2013-05-03 10:13:29 +00:00
Hans Petter Selasky
5b0752bbc1 Add some defines to limit USB memory usage in reduced memory systems. 2013-05-03 09:23:06 +00:00
Hans Petter Selasky
fa49bce566 Allow the default USB template to be specified at compile time. 2013-05-03 08:19:09 +00:00