Commit Graph

2476 Commits

Author SHA1 Message Date
Andrew Thompson
031c7388a2 Add device ID.
PR:		usb/142427
2010-01-29 01:27:54 +00:00
Andrew Thompson
97ccc89052 Use device_printf rather than printf + device_get_nameunit. 2010-01-28 22:54:01 +00:00
Andrew Thompson
8b1d9a81e9 Release the firmware after loading to the device. 2010-01-28 22:46:04 +00:00
Andrew Thompson
069f1a8056 Add run(4), a driver for Ralink RT2700U/RT2800U/RT3000U USB 802.11agn devices.
This driver was written for OpenBSD by Damien Bergamini and ported over by
Akinori Furukoshi.
2010-01-28 22:24:54 +00:00
Alexander Motin
83c5d981ac MFp4: Large set of CAM inprovements.
- Unify bus reset/probe sequence. Whenever bus attached at boot or later,
CAM will automatically reset and scan it. It allows to remove duplicate
code from many drivers.
- Any bus, attached before CAM completed it's boot-time initialization,
will equally join to the process, delaying boot if needed.
- New kern.cam.boot_delay loader tunable should help controllers that
are still unable to register their buses in time (such as slow USB/
PCCard/ CardBus devices), by adding one more event to wait on boot.
- To allow synchronization between different CAM levels, concept of
requests priorities was extended. Priorities now split between several
"run levels". Device can be freezed at specified level, allowing higher
priority requests to pass. For example, no payload requests allowed,
until PMP driver enable port. ATA XPT negotiate transfer parameters,
periph driver configure caching and so on.
- Frozen requests are no more counted by request allocation scheduler.
It fixes deadlocks, when frozen low priority payload requests occupying
slots, required by higher levels to manage theit execution.
- Two last changes were holding proper ATA reinitialization and error
recovery implementation. Now it is done: SATA controllers and Port
Multipliers now implement automatic hot-plug and should correctly
recover from timeouts and bus resets.
- Improve SCSI error recovery for devices on buses without automatic sense
reporting, such as ATAPI or USB. For example, it allows CAM to wait, while
CD drive loads disk, instead of immediately return error status.
- Decapitalize diagnostic messages and make them more readable and sensible.
- Teach PMP driver to limit maximum speed on fan-out ports.
- Make boot wait for PMP scan completes, and make rescan more reliable.
- Fix pass driver, to return CCB to user level in case of error.
- Increase number of retries in cd driver, as device may return several UAs.
2010-01-28 08:41:30 +00:00
Weongyo Jeong
1d3d5952a3 adds sysctl knobs to show rate statistics that it could be useful to
debug slow TX speed.
2010-01-27 19:43:14 +00:00
Weongyo Jeong
07f8d9afd2 Product ID of D-Link DWA-120 after loading the firmware is incorrect. 2010-01-19 01:26:40 +00:00
Weongyo Jeong
97ac268fcb removes a hack to attach TRENDnet TEW-504UB/EU that I think this issue
is solved with r202607.  Now idProduct of all uath(4) devices should be
decreased after loading the firmware.
2010-01-19 01:11:27 +00:00
Andrew Thompson
f644abcf6e Grammar nits.
Submitted by:	Ben Kaduk
2010-01-14 01:16:20 +00:00
Andrew Thompson
9b6ffc1f49 Update to Fredrik's latest uhso driver. This changes port detection, adds
comments and other code nits.

Submitted by:	Fredrik Lindberg <fli@shapeshifter.se>
2010-01-13 20:54:18 +00:00
Andrew Thompson
941e286383 Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ
from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than
using PPP over serial. uhsoctl(1) is used to initiate and close the WAN
connection.

Obtained from:	Fredrik Lindberg <fli@shapeshifter.se>
2010-01-13 03:16:31 +00:00
Andrew Thompson
e191eb5a50 Add the Globetrotter GE40x.
Submitted by:	Mike Tancsa
2010-01-11 00:18:40 +00:00
Edward Tomasz Napierala
07020dae57 Remove unused uhci_dump_qhs().
Reviewed by:	hps
2010-01-08 15:52:06 +00:00
Andrew Thompson
e54f81e0b9 Remove unneeded includes. 2010-01-08 01:41:58 +00:00
Martin Blapp
c2ede4b379 Remove extraneous semicolons, no functional changes.
Submitted by:	Marc Balmer <marc@msys.ch>
MFC after:	1 week
2010-01-07 21:01:37 +00:00
Andrew Thompson
e33b1a7e54 Fix debug printf on 64bit arches.
Spotted by:	b. f.
2010-01-07 02:25:19 +00:00
Andrew Thompson
1feda9b418 Add new umass quirks for Western Digital MYBook and JMicron JM20337.
PR:		usb/142225, usb/142228
Submitted by:	Thomas Ward, Yoshikazu GOTO
MFC after:	1 week
2010-01-07 00:30:59 +00:00
Andrew Thompson
d84a79e731 Improve u3g device ejecting by providing additional methods for the eject
command in the usb_msctest routines, as well as a general tidyup.

This now properly ejects the ZTE MF636, Option Gi0322 and Novatel MC950D
devices I have on my desk.
2010-01-06 22:14:05 +00:00
Andrew Thompson
c10e1453e7 scratch_size was incorrectly passed as language ID when retrieving the language
ID table, this broke string retrieval on some devices.

Submitted by:	Hans Petter Selasky
Reported by:	Renato Botelho
2010-01-06 21:46:08 +00:00
Andrew Thompson
87b88f757d Add new device ID to uipaq driver
PR:		usb/141936
Submitted by:	HASHI Hiroaki
2009-12-31 00:55:50 +00:00
Andrew Thompson
b55b073f14 Compact USB_VENDOR_X and USB_PRODUCT_Y in the quirk tables. 2009-12-28 00:42:42 +00:00
Andrew Thompson
9e6b53136e Use macros to strip off USB_VENDOR_ and USB_PRODUCT_ from some id tables to make
them more compact and readable.
2009-12-26 19:03:28 +00:00
Andrew Thompson
47d54fbb13 Shorten the USB_QUIRK_ENTRY macro and undef it at the end, its only internal. 2009-12-23 01:41:52 +00:00
Andrew Thompson
eb58441685 Move all Mass Storage Quirks over to the USB quirk module.
Submitted by:	Hans Petter Selasky
2009-12-23 01:16:24 +00:00
Andrew Thompson
7b360bcc6c Sync usb vendor/product defines to p4
Submitted by:	HPS
2009-12-23 01:12:54 +00:00
Andrew Thompson
46e977391b Add missed usb product define in r200826. 2009-12-22 02:15:36 +00:00
Andrew Thompson
cc92254a07 add new ID to UFTDI driver.
Submitted by:	YAMAMOTO, Shigeru
2009-12-22 02:13:23 +00:00
Andrew Thompson
725f67ad7b Add more OHCI pci ids.
Submitted by:	Hans Petter Selasky
2009-12-22 01:59:17 +00:00
Andrew Thompson
bae15f4ab1 Add more EHCI pci ids.
Submitted by:	Hans Petter Selasky
2009-12-22 01:57:34 +00:00
Andrew Thompson
b340b7be10 Keep list sorted. 2009-12-18 00:36:30 +00:00
Andrew Thompson
c0e2c17865 Add a bunch of new 3G ids obtained from from various operating systems and
Internet sources.

Obtained from:	Linux, NetBSD, OpenBSD, etc
2009-12-18 00:34:58 +00:00
Andrew Thompson
2a4c6157ca Use the EVENTHANDLER system to hook into the usb device configuration and
perform a function such as ejecting a 3G autoinstaller disk. The eventhandler
system properly tracks threads and is safe to unload, remove the
setting/clearing of a function pointer in the kernel by u3g(4) which included a
tsleep for safety.
2009-12-17 21:42:10 +00:00
Andrew Thompson
ae6de8d67a Wrap long lines. 2009-12-11 02:52:14 +00:00
Andrew Thompson
4b5437a114 Add a quirk for the Curitel UM175 where setting multiplexing for call
management over the data endpoint causes communication to die.

Take this one step further and model it on the existing NetBSD quirk and import
other device IDs from them.

Obtained from:	NetBSD
2009-12-11 02:44:15 +00:00
Andrew Thompson
84d250f195 Revert r199331, the UM175 is in fact a cdc-acm device handled by umodem(4). 2009-12-11 00:57:30 +00:00
Andrew Thompson
4a0bce1923 Fix hardware issue with FTDI chips: avoid sending a zero length packet due to
hardware sending garbage on ZLPs.

Reported by:	Corey Smith
Submitted by:	HPS
2009-12-09 20:28:33 +00:00
Andrew Thompson
85e3d588a5 Fix dwSignature for NCM mode and add extra debug output.
Submitted by:	HPS
2009-12-09 20:27:06 +00:00
Andrew Thompson
27148a6c72 Add new device ids.
PR:		usb/140951, usb/140923
Submitted by:	Romain Tartiere, Brett Glass
2009-12-09 20:24:49 +00:00
Andrew Thompson
741194f111 Correct name, 82801IJ -> 82801JI
Submitted by:	mitya_cabletv.dp.ua
2009-12-09 20:17:22 +00:00
Andrew Thompson
0ca80d71d0 If the ID byte is non zero then we allow descriptors having multiple sizes.
Submitted by:	HPS
Reported by:	daichi
2009-12-09 20:15:05 +00:00
Rui Paulo
64e5a27754 Improve response to multi-touch taps.
Submitted by:	Rohit Grover <rgrover1 at gmail.com>
2009-12-08 00:52:59 +00:00
Andrew Thompson
ce70efd12e Add uhci/ehci controller ids.
Submitted by:	mitya_cabletv.dp.ua
2009-12-03 23:24:12 +00:00
Nathan Whitehorn
d7e7c660b4 Early-generation touchpads do not send periodic calibration frames for
baseline subtraction, and are very temperature sensitive, so would slowly
drift out of a calibrated state when under load. Escape this by taking
the last frame before we decide that the pad is idle as a finger-free
baseline.

Tested on:	iBook G4
2009-11-29 20:48:19 +00:00
Ed Schouten
d343f5397d Remove unneeded inclusion of <sys/termios.h>. 2009-11-28 13:20:29 +00:00
Andrew Thompson
767cb2e29d Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.
2009-11-26 00:43:17 +00:00
Andrew Thompson
e6af527c11 Disable interrupts after doing early takeover of the usb controller in case usb
isnt actually compiled in (or kldloaded) as the controller could cause spurious
interrupts.

Tested by:	Florian Smeets
2009-11-25 20:50:43 +00:00
Andrew Thompson
bda9babe90 Actually disable interrupts in ehci_detach().
Reviewed by:	HPS
2009-11-23 18:12:09 +00:00
Andrew Thompson
3e65f9971a Make the mode setting transfer asynchronous.
Submitted by:	Rohit Grover
2009-11-22 21:53:09 +00:00
Andrew Thompson
add5cc2fad Add missed register change in r199676.
Submitted by:	Hans Petter Selasky
2009-11-22 21:31:31 +00:00
Andrew Thompson
f1eac1007e Correct register access for USB device side operation on the musb controller.
Submitted by:	Hans Petter Selasky
2009-11-22 21:24:38 +00:00
Andrew Thompson
c13fd8d42b Provide tunables for some of the usb sysctls that affect boot behaviour.
Submitted by:	Andriy Gapon
2009-11-22 21:21:22 +00:00
Andrew Thompson
78c94708fb Initialise variable before use.
Submitted by:	Hans Petter Selasky
2009-11-22 21:19:01 +00:00
Andrew Thompson
f12c6c2913 Improve High Speed slot allocation mechanism by moving the computation to the
endpoint rather than per xfer and provide functions around get/free of resources.

Submitted by:	Hans Petter Selasky
2009-11-22 21:16:43 +00:00
Andrew Thompson
185d20b5f9 Sort ID list by vendor. 2009-11-16 20:36:43 +00:00
Andrew Thompson
2f5c868874 Add the Curitel UM175 3g device. 2009-11-16 20:35:16 +00:00
Nathan Whitehorn
b201cde68d Reduce probe priority of USB input devices to BUS_PROBE_GENERIC from
BUS_PROBE_SPECIFIC. This allows device-specific drivers like atp to
attach reliably.

Reviewed by:	hps
2009-11-11 03:17:51 +00:00
Nathan Whitehorn
d7f3684090 Add support for the touchpads found in later models of iBook and
Powerbook.

Reviewed by:	Rohit Grover <rgrover1 at gmail.com>
2009-11-10 19:14:06 +00:00
Rui Paulo
4d16b4ec42 Driver for the Apple Touchpad present on MacBook (non-Pro & Pro).
Submitted by:	Rohit Grover <rgrover1 at gmail.com>
MFC after:	2 months
2009-11-09 15:59:09 +00:00
Andrew Thompson
a1f7c632cc Correct Olympus quirk.
Submitted by:	Pavel Gubin
2009-11-08 21:08:50 +00:00
Andrew Thompson
9dac8e0ed2 Add missing mtx_destroy().
Submitted by:	Sebastian Huber
2009-11-08 21:07:47 +00:00
Andrew Thompson
883bb30022 improve support for high speed isochronous endpoints which does not run 1:1,
but needs intervalling 1:2, 1:4 or 1:8

Submitted by:	Hans Petter Selasky
2009-11-08 20:54:03 +00:00
Andrew Thompson
30b22abe40 Integrate lost interrupts patch from the old USB stack.
Some EHCI chips from VIA / ATI seem to trigger interrupts before writing back
the qTD status, or miss signalling occasionally under heavy load.  If the host
machine is too fast, we can miss transaction completion - when we scan the
active list the transaction still seems to be active. This generally exhibits
itself as a umass stall that never recovers.

We work around this behaviour by setting up this callback after any softintr
that completes with transactions still pending, giving us another chance to
check for completion after the writeback has taken place

Submitted by:	Alexander Nedotsuko
MFC after:	3 days
2009-11-08 20:51:15 +00:00
Andrew Thompson
10454ab700 ehci_init() will do reset and set the usbrev flag. Fix problem where
ehci_reset() was called before ehci_init().

PR:		usb/140242
Submitted by:	Sebastian Huber
2009-11-08 20:44:55 +00:00
Weongyo Jeong
35e8cd5f52 fixes a typo that value should be 0 not 10. 2009-11-03 21:47:07 +00:00
Andrew Thompson
0f92028501 - Add usb_fill_bulk_urb() and usb_bulk_msg() linux compat functions [1]
- Don't write actual length if the actual length pointer is NULL [2]
- correct Linux Compatibility error codes for short isochronous IN transfers
  and make status field signed.

Submitted by:	Leunam Elebek [1], Manuel Gebele [2]
2009-11-01 21:48:18 +00:00
Andrew Thompson
bb9c7a8b22 Fix a corner case where usbd_transfer_drain() can return too early if the
callback has dropped the mutex, leading to a panic.

Submitted by:	HPS
MFC after:	3 days
2009-11-01 21:44:37 +00:00
Andrew Thompson
acf4080f43 Check unit number and provide string name for consdev.
Submitted by:	HPS
2009-11-01 21:41:44 +00:00
Andrew Thompson
c2e8b89ce4 Revert r198500 for now, this will break situations when
hw.pci.usb_early_takeover is set to zero and the SMM release
is never done.

Pointed out by:	marcel
2009-10-26 21:47:16 +00:00
Andrew Thompson
77cbe30ea9 Remove usb controller takeover code now that it is handled by the pci code.
Reminded by:	jhb
Reviewed by:	HPS
2009-10-26 20:23:15 +00:00
Andrew Thompson
4ed0304c97 Allow dumping the USB mouse reports via 'sysctl -b dev.ums.N.parseinfo',
previously only available via bootverbose.

PR:		usb/137191
Submitted by:	Eygene Ryabinkin
2009-10-22 20:54:01 +00:00
Andrew Thompson
11cf5c2f81 Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device
has been yanked, this works around a cam recounting bug when
CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the
reference to the XPT device would not be released which would cause the usb
explore thread to sleep forever on "simfree", preventing any new usb devices to
be found/ejected on the bus.

This is intended to be a quick workaround to the problem without touching CAM
so it can be merged to 8.0.

Suggested by:	mav
MFC after:	3 days
2009-10-20 21:29:46 +00:00
Andrew Thompson
11f35cfaa7 Add support for newer WinChipHead CH341 chips, previously in the uch341 driver.
Submitted by:	HPS
2009-10-19 21:52:02 +00:00
Andrew Thompson
b20adc2b5a Remove the newly added uch341 driver, it will be merged into uchcom instead.
Suggested by:	takawata
Submitted by:	HPS
2009-10-19 21:43:59 +00:00
Weongyo Jeong
a0585a1450 overhauls urtw(4) for supporting RTL8187B devices properly that there
was major changes to initialize RF chipset and set H/W registers and
removed a lot of magic numbers on code.  Details are as follows:

  - uses the endpoint 0x89 to get TX status information which used to
    get TX complete or retry numbers or get a beacon interrupt.  It's
    only valuable for RTL8187B.
  - removes urtw_write[8|16|32]_i functions that it's useless now.
  - uses ic->ic_updateslot to set SLOT, SIFS, DIES, EIFS, CW_VAL
    registers that doesn't set these whenever the channel is changed.
  - code for initializing RF chipset for RTL8187B changed a lot that
    there was many problems on TX transfers so it doesn't work properly
    even if just for a ping/pong.  Now it becomes more stable than
    before that TX throughputs using netperf(1) were about 15 ~ 17Mbps/s
    though sometimes it encounters packet losses.
  - removes a lot of magic numbers that in the previous all of
    representing RX and TX descriptors were consisted of magic numbers
    and structures.  It'd be more readable rather than before.
  - calculates TX duration more accurately for urtw(4) devices.
  - style(9)
2009-10-18 00:11:49 +00:00
Andrew Thompson
290512231a Correct offset calcluation for the NCM implementation.
Submitted by:	HPS
2009-10-15 20:15:29 +00:00
Andrew Thompson
c3139ea6f9 Only poll ukbd if KDB is active.
Submitted by:	HPS
2009-10-15 20:09:27 +00:00
Andrew Thompson
1def609a63 Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
all host controllers at the same time, we avoid problems where the BIOS will
actually write to the USB registers of all the USB host controllers every time
we handover one of them, and consequently reset the OS programmed values.

Submitted by:	avg
Reviewed by:	jhb
2009-10-15 20:07:08 +00:00
Weongyo Jeong
941da6d392 fixes a TX hang that could be possible to happen when the trasfers are
in the high speed that some drivers don't call if_start callback after
marking ~IFF_DRV_OACTIVE.

MFC after:	3 days
2009-10-14 20:30:27 +00:00
Weongyo Jeong
db63fc93cc fixes a TX hang bug that it could happen when if_start callback didn't
be restarted by full of the output queue.

MFC after:	3 days
Tested by:	bsduser <bsd at acd.homelinux.org>
2009-10-14 20:09:09 +00:00
Hiroki Sato
aea0c7f367 Fix the 106/109 USB Japanese keyboard "underscore" issue.
Sun Type 6 USB keyboard support added in rev 1.46 conflicted with
some scan codes used in Japanese keyboards because the scan code
conversion routine was ambiguous for the overlapped codes.

PR:		ports/134005
Submitted by:	YAMASHIRO Jun
2009-10-12 19:19:08 +00:00
Weongyo Jeong
f8b51ca5e9 updates device entries supported with the product name not magic numbers
and sorts entries.  WUSB54GCV2 is added.

Obtained from:	OpenBSD
2009-10-04 23:30:08 +00:00
Andrew Thompson
c8a14b9124 EHCI Hardware BUG workaround
The EHCI HW can use the qtd_next field instead of qtd_altnext when a short
packet is received. This contradicts what is stated in the EHCI datasheet.
Also the total-bytes field in the status field of the following TD gets
corrupted upon reception of a short packet!  We work this around in software by
not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been
seen on multiple INTEL based EHCI chips.  Other vendors have not been tested
yet.

- Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not
  applications using LibUSB v0.1, v1.2 and v2.0.
- Mass Storage (umass) is affected.

Submitted by:	Hans Petter Selasky
MFC after:	3 days
2009-10-01 18:37:16 +00:00
Andrew Thompson
585b13f2cb Add back endpoint swap detection that was disabled in an earlier driver
conversion.

Submitted by:	Hans Petter Selasky
2009-09-28 08:18:14 +00:00
Andrew Thompson
7747063b8f Add new FTDI IDs.
Submitted by:	Maks Verver, Arrigo Marchiori
2009-09-28 08:15:26 +00:00
Andrew Thompson
655dc9d00a Add experimental support for usb serial console and polled mode during DDB.
Submitted by:	Hans Petter Selasky
2009-09-28 08:13:50 +00:00
Andrew Thompson
063e119dcd Add a config number quirk for the ELSA_MODEM1
Submitted by:	Stefan Bethke
2009-09-28 08:09:11 +00:00
Andrew Thompson
adedd2deb5 add more device IDs
Reported by:	Mike Tancsa
Submitted by:	Hans Petter Selasky
2009-09-28 08:07:20 +00:00
Andrew Thompson
87832c5e33 Allow setting of MAC address for AXE based ethernet adapters.
Submitted by:	yongari
2009-09-28 08:05:14 +00:00
Andrew Thompson
3ac526e01e Increase the rx buffer size to 16384 bytes, this increases RX performance from
50Mbps to 220Mbps on PLANEX GU-1000T.

Submitted by:	yongari
2009-09-28 08:03:52 +00:00
Andrew Thompson
a4fcd5cae9 - Remove SAMSUNG_YP_U2 now that it is in the cam layer
- Add quirk from Tobias Grosser for Western Mypassword

Submitted by:	Hans Petter Selasky
2009-09-28 08:00:17 +00:00
Andrew Thompson
30c257f8ae MFp4
Add new usbdev entries for Marvell, FTDI, Option and Western.
2009-09-28 07:57:23 +00:00
Andrew Thompson
4076dd2309 Add basic support for USB Network Control Model (NCM) v1.0 to if_cdce.c.
http://www.usb.org/developers/devclass_docs/NCM10.zip

Submitted by:	Hans Petter Selasky
2009-09-28 07:53:55 +00:00
Andrew Thompson
a872528155 Add extra safety locking when clobbering xfer->flags_int.started in start and
stop functions, because xfer->flags_int is also updated by the USB controller,
under the controller lock.

Submitted by:	Hans Petter Selasky
2009-09-28 07:46:22 +00:00
Andrew Thompson
35e0e60378 Correct buffer sizes used so that they match. The old code could give the
impression that a overflow situation existed but was not possible.

Reported by:	kib
Submitted by:	Hans Petter Selasky
2009-09-28 07:42:59 +00:00
Andrew Thompson
7a918edff2 Add support for USB language selection.
PR:		usb/138563
Reported by:	Bruce Cran
Submitted by:	Hans Petter Selasky
2009-09-28 07:41:17 +00:00
Andrew Thompson
a9e267575b Fix NULL-pointer dereference in usb_endpoint_foreach().
PR:		usb/138389
Submitted by:	Patroklos Argyroudis at census, inc
2009-09-28 07:39:51 +00:00
Andrew Thompson
3bfbd845ff Add support for ChipHead 341 serial port adapter.
Submitted by:	Hans Petter Selasky
2009-09-28 07:32:11 +00:00
Andrew Thompson
33ea13230a Clear all interrupts rather than just SETUP packet.
Submitted by:	Hans Petter Selasky
2009-09-28 07:10:32 +00:00
Andrew Thompson
2094ecda08 Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0)
statements to zero.

Submitted by:	Hans Petter Selasky
2009-09-28 07:09:17 +00:00
Andrew Thompson
6450e5babf Import two PCI quirks from Linux
- Add quirk for ATI SB600 and SB700 to free SMB controller
 - Correct schedule sleep time to 10us on the VIA ehci controller

Reported by:	Dorian B<FC>ttner, Andriy Gapon
Submitted by:	Hans Petter Selasky
2009-09-28 07:06:47 +00:00