Commit Graph

3164 Commits

Author SHA1 Message Date
Hans Petter Selasky
549c5c8798 Disable USB 3.0 streams mode by default, hence not all XHCI chipsets
implement it to avoid undefined behaviour.
2013-09-07 06:53:59 +00:00
Ruslan Bukin
c7e4729da4 Add support for DLINK DWA-127 Wireless Adapter
Approved by:	cognet (mentor)
2013-09-05 10:09:24 +00:00
Ian Lepore
e5efecdbeb Add the device ID for a new flavor of FTDI serial adapter (model 232EX). 2013-09-01 14:15:31 +00:00
Hans Petter Selasky
33f4aa115d Sync USB bluetooth product list with Linux.
MFC after:	1 week
2013-08-31 06:47:53 +00:00
Hans Petter Selasky
8f39f442c9 Bugfix: The endpoint profile should only be checked in device mode when
allocating USB transfers and not in host mode.

Reported by:	George Mitchell <george+freebsd@m5p.com>
2013-08-25 08:42:50 +00:00
Hans Petter Selasky
3a8f0c444a Force keyboards which don't have the required
HID fields to use the USB BOOT protocol for now.

PR:		usb/181425
Submitted by:	Andrey Zholos <aaz@q-fu.com>
MFC after:	4 weeks
2013-08-20 16:21:05 +00:00
Hans Petter Selasky
3147331e16 Fix some USB controller names according to pciconf output.
MFC after:	1 week
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-08-17 06:29:45 +00:00
Kevin Lo
612cf1ca01 Bring datasheet URL up to date. 2013-08-16 07:42:06 +00:00
Hans Petter Selasky
62a963c5f5 - Try to fix build of 32-bit compatibility USB support for FreeBSD and
Linux targets without breaking the existing IOCTL API.

- Remove some not-needed header file inclusions.

- Wrap a long line.

MFC after:	1 week
Reported by:	Damjan Jovanovic <damjan.jov@gmail.com>
2013-08-12 09:17:48 +00:00
Hans Petter Selasky
fcd51bb4fa Correct an EHCI register write.
MFC after:	1 week
Reported by:	aseem.jolly@gmail.com
2013-08-12 06:09:28 +00:00
Rui Paulo
53dfd5c108 Cleanup the allocations when the attachment fails. 2013-07-31 06:05:34 +00:00
Rui Paulo
6d9b2f85f8 Unbreak sparc64 LINT. Need to fix this correctly at some point in the future. 2013-07-30 16:17:30 +00:00
Rui Paulo
31d9867769 Import OpenBSD's rsu(4) WLAN driver.
Support chipsets are the Realtek RTL8188SU, RTL8191SU, and RTL8192SU.

Many thanks to Idwer Vollering for porting/writing the man page and for
testing.

Reviewed by:	adrian, hselasky
Obtained from:	OpenBSD
Tested by:	kevlo, Idwer Vollering <vidwer at gmail.com>
2013-07-30 02:07:57 +00:00
Hans Petter Selasky
e8353a7a69 Fix alignment of USB WLAN radiotap headers. This makes USB WLAN adapters
work on ARM, MIPS and similar platforms, where alignment matters.

MFC after:	1 week
Reported by:	XiaoQI Ge <ghw@7axu.com>
2013-07-29 05:54:13 +00:00
Hans Petter Selasky
06fc83e85b Assume that all Apple products using interface class 255, subclass 253
and protocol 1 are USB ethernet adapters. This avoids keeping and updating
the product list every now and then. This patch will add support for the
USB ethernet interface found in the IPAD.

MFC after:	1 week
2013-07-26 09:58:56 +00:00
David E. O'Brien
1ae56a1ce4 per style(9):
Kernel include files (i.e. sys/*.h) come first; normally, include
   <sys/types.h> OR <sys/param.h>, but not both.  <sys/types.h> includes
   <sys/cdefs.h>, and it is okay to depend on that.
2013-07-24 18:32:15 +00:00
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
Hans Petter Selasky
c77a24c24a Add new USB API to get the port path of a USB device.
MFC after:	2 weeks
Requested by:	emaste @
2013-05-03 07:44:58 +00:00
Gleb Smirnoff
47e8d432d5 Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
Hans Petter Selasky
751aaf5a93 Add convenience wrapper functions to run callbacks in the context of the
USB explore thread.
2013-04-23 10:42:15 +00:00
Hans Petter Selasky
0cfbd57ebc Add descriptive comment. 2013-04-23 06:26:54 +00:00
Hans Petter Selasky
d81b160aa5 Add OHCI controller ID.
MFC after:	2 weeks
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-04-21 16:02:50 +00:00
Gabor Kovesdan
f0d0985ee9 - Correct mispellings of word miscellaneous
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:43:46 +00:00
Alexander Motin
ec5cd81891 Add ID for ASMedia ASM1042 USB 3.0 controller.
MFC after:	1 week
2013-04-10 17:43:20 +00:00
Hans Petter Selasky
3550618d0b Fix regression issue after r248910.
PR:		arm/177685
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
2013-04-07 13:03:57 +00:00
Hans Petter Selasky
a1e969b8b2 Add new USB ID.
PR:		usb/177666
Submitted by:	Nicolai Petri <nicolai@petri.dk>
2013-04-06 17:00:11 +00:00
Hans Petter Selasky
15d4edd3d4 Add missing ifdef's for reduced feature compilations. 2013-04-03 10:31:13 +00:00
Hans Petter Selasky
11a1335af9 Add new USB ID.
MFC after:	1 week
Submitted by:	Bruce Simpson <bms@fastmail.net>
2013-04-03 06:45:21 +00:00
Hans Petter Selasky
3232aae327 Add new USB ID.
PR:		usb/177173
MFC after:	1 week
2013-03-21 07:04:17 +00:00
Aleksandr Rybalko
a2c472e741 Integrate Efika MX project back to home.
Sponsored by:	The FreeBSD Foundation
2013-03-20 15:39:27 +00:00
Hans Petter Selasky
76be9c89ba Fix spelling. 2013-03-20 11:51:26 +00:00
Hans Petter Selasky
565d8205f3 Add new USB ID.
PR:		usb/177105
MFC after:	1 week
2013-03-19 12:52:13 +00:00
Hans Petter Selasky
bd247e9ddd Add new USB ID.
PR:		usb/177013
MFC after:	1 week
2013-03-18 07:02:58 +00:00
Hans Petter Selasky
a1a10f530c Fix typo. 2013-03-13 15:42:04 +00:00
Hans Petter Selasky
23de050b72 - Make quirk for reading device descriptor from broken USB devices.
Else they won't enumerate at all:
hw.usb.full_ddesc=1
- Reduce the USB descriptor read timeout from 1000ms to
500ms. Typical value for LOW speed devices is 50-100ms.
- Enumerate USB device a maximum of 3 times when a port
connection change event is detected, before giving up.

MFC after:	1 month
2013-03-13 15:38:01 +00:00
Gavin Atkinson
cd4c88cad4 Add support for Optoelectronics USB barcode readers to uftdi(4).
Add entries for other Optoelectronics devices to usbdevs.

MFC after:	1 week
2013-03-11 22:17:39 +00:00
Hans Petter Selasky
2e39e9ee71 Fix init/uninit function type. 2013-02-25 10:57:35 +00:00
Hans Petter Selasky
8cb536dd39 Add new USB ID.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-02-25 08:24:21 +00:00
Hans Petter Selasky
1b9c9ab29a Fix bad EEPROM parsing code.
MFC after:	2 weeks
2013-02-18 17:55:27 +00:00
Hans Petter Selasky
aafcb73207 Add USB API to read power draw on USB devices.
Update usbconfig to print power draw on USB devices.

MFC after:	2 weeks
Submitted by:	Matt Burke @ icritical.com
2013-02-14 12:22:40 +00:00
Hans Petter Selasky
626d8465fb Remove unused variable.
MFC after:	1 week
2013-02-13 15:43:15 +00:00
Hans Petter Selasky
a18a7a414a Resolve a LOR after r246616. Protect control requests using the USB device
enumeration lock. Make sure all callers of usbd_enum_lock() check the return
value. Remove the control transfer specific lock. Bump the FreeBSD version
number, hence external USB modules may need to be recompiled due to a USB
device structure change.

MFC after:	1 week
2013-02-13 12:35:17 +00:00
Hans Petter Selasky
b7f9bfb502 Add new USB ID to FTDI driver.
MFC after:	1 week
PR:		kern/175893
Submitted by:	Tomek
2013-02-13 08:28:27 +00:00
Hans Petter Selasky
6950c75f40 - Move scratch data from the USB bus structure to the USB device structure
so that simultaneous access cannot happen. Protect scratch area using
the enumeration lock. Also reduce stack usage in usbd_transfer_setup()
by moving some big stack members to the scratch area. This saves around
200 bytes of stack.
- Fix a whitespace.

MFC after:	1 week
2013-02-10 10:56:13 +00:00
Hans Petter Selasky
74b50dd979 Fix correct use of USB header files. 2013-02-10 10:55:20 +00:00
Hans Petter Selasky
645e4d17f0 - Streamline detach logic in wlan drivers, so that
freed memory cannot be used during detach.
- Remove all panic() calls from the urtw driver because
  panic() is not appropriate here.
- Remove redundant checks for device detached in
  device detach callbacks.
- Use DEVMETHOD_END to mark end of device methods.

MFC after:	2 weeks
2013-02-10 10:36:16 +00:00
Hans Petter Selasky
056e0b5dcd Make sure we don't leak command buffers when a USB
command transfer fails.

MFC after:	1 week
Reported by:	Ian FREISLICH
2013-02-08 22:51:09 +00:00
Hans Petter Selasky
2d8a425be0 Fix regression issue after r244503:
Correct init order to fix a NULL pointer access.

MFC after:	1 week
Reported by:	Ian FREISLICH
2013-02-08 21:15:47 +00:00
Hans Petter Selasky
9b3a48ee6f Add defines to more easily allow a single threaded version of the FreeBSD
USB stack. This is useful for non-kernel purposes, like the loader.
2013-02-05 14:44:25 +00:00
Hans Petter Selasky
ff182db6c8 Fix some nits. 2013-02-05 13:30:07 +00:00
Hans Petter Selasky
664413a163 Fix for hardware checksum offloading in SMSC driver.
This also fixes IPv6 support for this particular hardware.

Submitted by:	Daisuke Aoyama
2013-02-01 07:26:25 +00:00
Hans Petter Selasky
7b0866b032 Make use of USB ID sections configurable. 2013-02-01 07:05:43 +00:00
Sofian Brabez
61bfd86762 Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
Reviewed by:	cognet
Approved by:	cognet
2013-01-30 18:01:20 +00:00
Hans Petter Selasky
e465b973a1 Do not unnecessarily split a string literal, because
splitting it makes it hard to grep.

Submitted by:	Christoph Mallon
2013-01-30 16:08:05 +00:00
Hans Petter Selasky
b51875c9f6 Use string literals in string descriptors for marginally
better readability.

Submitted by:	Christoph Mallon
2013-01-30 16:05:54 +00:00
Hans Petter Selasky
01923b399d Use an anonymous struct for generated string descriptors.
Submitted by:	Christoph Mallon
2013-01-30 15:49:37 +00:00
Hans Petter Selasky
23ab08715c Provide one global language string descriptor for
american english instead of giving each module its
own.

Submitted by:	Christoph Mallon
2013-01-30 15:46:26 +00:00
Hans Petter Selasky
d2b99310b1 Modify the FreeBSD USB kernel code so that it can be compiled directly
into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems
or embedded platforms. This is also useful for out of the system compilation
of the FreeBSD USB stack for various purposes. The USB kernel files can
now optionally include a global header file which should include all needed
definitions required to compile the FreeBSD USB stack. When the global USB
header file is included, no other USB header files will be included by
default.

Add new file containing the USB stack configuration for the
FreeBSD loader build.

Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all
USB files follow the same style.

Use cases:
 - console in loader via USB
 - loading kernel via USB

Discussed with:		Hiroki Sato, hrs @ EuroBSDCon
2013-01-30 15:26:04 +00:00
Hans Petter Selasky
7e7b1248d1 Add missing header file inclusion guard. 2013-01-30 10:59:42 +00:00
Hans Petter Selasky
250fb892d3 Add missing NULL pointer check.
Reported by:	Lars Engels
MFC after:	1 week
2013-01-30 07:48:43 +00:00
John Baldwin
a8df530ddc Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the
compiler from caching their values in tight loops.

Reviewed by:	bde
MFC after:	1 week
2013-01-28 19:38:13 +00:00
Hans Petter Selasky
3758c66a4f Remove some extra and not needed space characters.
MFC after:	1 week
2013-01-28 10:52:24 +00:00
Hans Petter Selasky
1ef133b390 Add new USB ID.
Submitted by:	Ramil
PR:		usb/175639
MFC after:	1 week
2013-01-28 07:22:44 +00:00
Hans Petter Selasky
b7b11d00f6 Fix regression issue after r244500 and r244503:
If a BUSDMA load operation results in a single segment which
is greater than the PAGE_SIZE, the USB computed physical
addresses will not be correct. Make sure that the first
segment is unfolded like the sub-sequent segments are into
USB_PAGE_SIZE big ranges.

Found by:	Alexander Nedotsukov
MFC after:	1 week
2013-01-27 18:01:03 +00:00
Hans Petter Selasky
5a47db4708 Add new USB quirk.
PR:		usb/175599
Submitted by:	Juan J Lopez
MFC after:	1 week
2013-01-26 13:44:24 +00:00
Hans Petter Selasky
a9216e0b16 Add new quirk and correct old one.
PR:		usb/175454
MFC after:	1 week
2013-01-21 07:02:41 +00:00
Alexander Kabaev
e15f85e71c Do not pretend to have autosense data when no such data is available.
Make umass return an error code if SCSI sense retrieval request
has failed. Make sure scsi_error_action honors SF_NO_RETRY and
SF_NO_RECOVERY in all cases, even if it cannot parse sense bytes.

Reviewed by: hselasky (umass), scottl (cam)
2013-01-19 03:19:39 +00:00
Hans Petter Selasky
c25ca7790c Add new u3g device quirk.
Submitted by:	Lowell Gilbert
MFC after:	1 week
2013-01-14 17:41:04 +00:00
Alexander Motin
cda00e8ccd Freeze device queue before returning errors to CAM. This is required
for proper error recovery, including keeping original request order.

Reviewed by:	hselasky
2013-01-12 11:36:23 +00:00
Hans Petter Selasky
bdf43bb5c3 Bugfix: Fix sizeof() argument.
Found by:	Haakon Loevdal
MFC after:	1 week
2013-01-10 08:06:12 +00:00
Hans Petter Selasky
60867f577a Fix detection of Razer Copperhead as a USB mouse.
Factor out USB mouse and keyboard detection logic.
Reject USB keyboards which have mouse alike HID items
in their HID descriptors.

Submitted by:	Matthew W
MFC after:	1 week
2013-01-10 07:45:46 +00:00
Hans Petter Selasky
6317f31612 Shave off another register write to save some more
microseconds of PCI access time.

Tested by:	sos @
Submitted by:	sos @
MFC after:	1 week
2013-01-08 19:38:57 +00:00
Hans Petter Selasky
878b1fbdce Optimise the XHCI interrupt handling.
This patch will save CPU time when the XHCI interrupt is
shared with other devices.
Only check event rings when interrupt bits are set.
Otherwise would indicate hiding possible hardware fault(s).

Tested by:	sos @
Submitted by:	sos @
MFC after:	1 week
2013-01-07 16:38:13 +00:00
Hans Petter Selasky
d021dd19b6 Fix for "run0: wcid=xx out of range" error message.
MFC after:	1 week
PR:		usb/174963
Submitted by:	PseudoCylon <moonlightakkiy@yahoo.ca>
2013-01-04 20:44:17 +00:00
Hans Petter Selasky
92e2321883 Add new USB ID.
PR:		usb/174814
Submitted by:	Andy Balholm
MFC after:	1 week
2012-12-29 21:22:38 +00:00
Mark Johnston
7716eb4c40 Add the NO_SYNC_CACHE quirk for all Apple USB MSC devices, as they
typically do not handle the SYNCHRONIZE_CACHE command - they either
return an error or the firmware enters a reset loop.

Reviewed by:	hselasky
Approved by:	rstone (co-mentor)
MFC after:	2 weeks
2012-12-26 22:21:27 +00:00
Hans Petter Selasky
607bbcba30 Fix more regression issue after r244503.
usbd_transfer_setup() does not set a default length for USB transfers.
Only the number of frames is automatically setup.

MFC after:	1 week
2012-12-24 10:10:18 +00:00
Hans Petter Selasky
2691bc24f1 Fix regression issue after r244503.
MFC after:	1 week
2012-12-23 10:21:01 +00:00
Hans Petter Selasky
1a7c3e9097 Regression issue:
Use a boundary of zero, hence a PAGE_SIZE boundary
is implied by all memory allocations.

Background:
Busdma has problems to allocate more than PAGE_SIZE
bytes when the boundary is PAGE_SIZE bytes too.
Initially it was thought that a boundary of PAGE_SIZE
bytes will only affect loading of DMA memory, so that
segments get split correctly, but it also affects
allocation of DMA'able memory.

Solution:
USB can detect big segments and split them as required
by the USB code.

MFC after:	1 week
Reported by:	gonzo
2012-12-21 14:17:39 +00:00
Hans Petter Selasky
c180b3986d Make sure all USB drivers allocate buffer memory
through the USB API and/or busdma.

The following assumptions have been made:
umass - buffers passed from CAM/SCSI layer are OK
network - mbufs are OK.

Some other nits while at it.

MFC after:	1 week
Suggested by:	imp
2012-12-20 18:38:02 +00:00
Hans Petter Selasky
a6d2f40ec8 Allocate separate USB buffers for DMA'ed data, so that
DMA data does not reside next to non DMA data. This
might cause more memory to be allocated, but solves
problems on platforms using manual cache
synchronization.

Add a convenience function to get the buffer only
from a USB transfer's page cache structure.

MFC after:	1 week
Suggested by:	imp
2012-12-20 18:13:37 +00:00
Hans Petter Selasky
f578aba724 Add support for throttling UMASS.
Mostly useful for debugging purposes.

MFC after:	1 week
2012-12-20 17:14:10 +00:00
Hans Petter Selasky
3d6709a572 Make sure we block recursion on TTY's inwakeup callback
Suggested by:	davide
MFC after:	1 week
2012-12-20 16:21:02 +00:00
Hans Petter Selasky
9fbf6da58c Add new USB ID.
MFC after:	1 week
Submitted by:	Artyom Mirgorodskiy
2012-12-09 09:58:44 +00:00
Gleb Smirnoff
c6499eccad Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.
2012-12-04 09:32:43 +00:00
Hans Petter Selasky
5e184962dd - Add support for Etron EJ168 USB 3.0 Host Controllers.
This brand of controllers expects that the number of
contexts specified in the input slot context points
to an active endpoint context, else it refuses to
operate.

- Ring the correct doorbell when streams mode is used.
- Wrap one or two long lines.

Tested by:	Markus Pfeiffer (DragonFlyBSD)
MFC after:	1 week
2012-12-01 22:13:38 +00:00
Eitan Adler
1a12569c85 Add support for AT&T Sierra Wireless USB 3G adapter
PR:		kern/173982
Submitted by:	Eric Camachat <eric@camachat.org>
Approved by:	cperciva (implicit)
MFC after:	1 week
2012-11-29 00:32:03 +00:00
Hans Petter Selasky
8e5e664ccc Remove no longer needed quirk.
Submitted by:	Mark Johnston
2012-11-23 08:22:06 +00:00
Oleksandr Tymoshenko
82b036b9c6 Look for MAC address in FDT tree nodes that are usb network devices and
have either "mac-address" or "local-mac-addrress" property.
2012-11-23 03:34:12 +00:00
Hans Petter Selasky
9efb73396e Fix uplcom clear stall logic for PL2303HX.
Submitted by:	Mark Johnston
MFC after:	1 week
2012-11-21 22:04:40 +00:00
Hans Petter Selasky
b70f0569e8 Add new USB IDs.
MFC after:	1 week
PR:		usb/173503
2012-11-12 07:25:51 +00:00
Hans Petter Selasky
e71628651b Fix LOW and FULL speed USB INTERRUPT endpoint support for the
DWC OTG driver. Fix a hang issue when using LOW and FULL speed
BULK traffic. Make sure we don't ask for data in the last
microframe. This allows using devices like USB mice and USB
keyboards connected to the RPI-B.

Suggested by:	gonzo @
2012-11-09 16:28:58 +00:00
Hans Petter Selasky
78abbdd54f Make the USB ethernet methods constant again in if_udav.c,
so that both adapter variants can be attached at the same
time.

MFC after:	0 days
2012-11-08 16:31:13 +00:00
Kevin Lo
b72d9fd455 Add new USB device ID. 2012-11-08 09:29:05 +00:00
Hans Petter Selasky
9a630052d4 Add lock asserts instead of "auto-locking".
MFC after:	1 weeks
Suggested by:	ed @
2012-11-07 18:59:42 +00:00
Hans Petter Selasky
3b8e984374 The tty_inwakeup callback appears to be called both locked and unlocked.
Handle the required locking automatically for now.

MFC after:	1 weeks
2012-11-07 18:44:05 +00:00
Hans Petter Selasky
3e2d883535 Patch to improve USB serial console.
MFC after:	1 weeks
Submitted by:	Bruce Evans
2012-11-07 08:13:56 +00:00
Marcel Moolenaar
ef3afadd29 Add the UQ_MSC_NO_PREVENT_ALLOW quirk to handle devices that do not support
the 'PREVENT/ALLOW MEDIUM REMOVAL' SCSI command. An example of such a
device is the STmicro ST72682. We send the SCSI command for every open and
close, which can result in a significant amount of spam on the console
during boot.

Reviewed by:	hps@
2012-11-05 21:03:38 +00:00
Hans Petter Selasky
d30d96ea57 Add a jitter buffer in the common USB serial driver code which
temporarily stores characters if the TTY buffer is full when
used a as a console. This can happen when a console is suspended.
Also properly do the flow stop signalling when this happens and
flow start when the condition changes back to normal again.

Bump __FreeBSD_version to force external kernel modules
to be recompiled. No kernel API changes.

MFC after:	1 week
Suggested by:	ed @
2012-11-05 17:50:40 +00:00
Marcel Moolenaar
db43ed3750 Allow using the embedded EHCI host controller in Freescale SoCs
by adding the missing bits. See ehci_fsl.c for their use.
2012-11-03 21:05:32 +00:00
Hans Petter Selasky
7a75e881d7 If a USB mass storage device doesn't respond properly
to the initial SCSI INQUIRY command, enable all quirks.
This fixes detection of some Transcend TS2GUFM devices.

MFC after:	1 week
Reported by:	Michael Dexter
2012-10-30 16:56:16 +00:00