Commit Graph

3164 Commits

Author SHA1 Message Date
Kevin Lo
51fcfa2666 Fix comment. 2014-01-24 15:34:22 +00:00
Hans Petter Selasky
5c8c627bf9 Hide now harmless warning from dmesg.
MFC after:	1 week
2014-01-24 15:05:28 +00:00
Kevin Lo
56ae078529 Get rid of memmove(). It's not portable.
Tested on RT3071, RT3573, RT3570, RT3572, and RT5572.

Reviewed by:	hselasky
2014-01-24 09:17:29 +00:00
Hans Petter Selasky
2719d9c909 Revert r261014. Let Kevin fix it.
MFC after:	1 week
2014-01-23 10:18:28 +00:00
Hans Petter Selasky
dfd7cd8014 We are using the old callout API and should also add one extra tick in
the FreeBSD 10 case.

Suggested by:	mav @
MFC after:	1 week
2014-01-22 17:50:43 +00:00
Hans Petter Selasky
2e74d8c857 - Fix some non-portable code with regard to endianness. Don't use memmove().
- Fix a range check for maximum transmit length.
- Fix read from missing field when transmitting data.

MFC after:	2 weeks
2014-01-22 09:57:26 +00:00
Hans Petter Selasky
924b1f5db0 Ensure that the DMA delay does not get rounded down to zero ticks when
a timeout value of a single tick is given. With FreeBSD-10 and newer
the current system time is used as a starting point, and the minimum
callout time of a single tick will be guaranteed. This patch mostly
affect the DMA delay timeouts, which are typically in the range from
0.125 to 2ms.

MFC after:	1 week
2014-01-22 07:48:39 +00:00
Hans Petter Selasky
3448548027 Wait a bit more before we free any EHCI DMA descriptors. Some USB
controllers need more time than others.

MFC after:	1 week
2014-01-22 07:32:55 +00:00
Hans Petter Selasky
338b63a918 Add new quirk.
PR:		usb/185968
MFC after:	1 week
2014-01-22 07:22:42 +00:00
Hans Petter Selasky
62b97a9adf Add support for GPS ports to UHSO driver.
Submitted by:	Lundberg, Johannes <johannes@brilliantservice.co.jp>
MFC after:	1 week
2014-01-20 07:09:19 +00:00
Hans Petter Selasky
f97da128ab Fix a possible memory use after free and leak situation associated
with USB device detach when using character device handles. This also
includes LibUSB. It turns out that "usb_close()" cannot always get a
reference to clean up its USB transfers and such, if called during the
kernel USB device detach.

Analysis by:	hselasky @
Reported by:	Juergen Lock <nox@jelal.kn-bremen.de>
MFC after:	1 week
2014-01-17 10:35:18 +00:00
Hans Petter Selasky
c7d8c1c6e0 Close a minor deadlock.
MFC after:	1 week
2014-01-17 08:21:09 +00:00
Hans Petter Selasky
8af981a406 Don't output any modifier keys before we see a valid
non-modifier key press. This prevents so-called "ghost
keyboards" keeping modifier keys pressed while not
actually seen as a real keyboard.

MFC after:	2 weeks
2014-01-14 08:43:38 +00:00
Hans Petter Selasky
a0d53e0b38 Implement better error recovery for Transaction Translators, TTs,
found in High Speed USB HUBs which translate from High Speed USB into
FULL or LOW speed USB. In some rare cases SPLIT transactions might get
lost, which might leave the TT in an unknown state. Whenever we detect
such an error try to issue either a clear TT buffer request, or if
that is not possible reset the whole TT.

MFC after:	1 week
2014-01-13 15:21:11 +00:00
Hans Petter Selasky
a148d44fb5 Separate I/O errors from reception of STALL PID.
MFC after:	1 week
2014-01-13 15:06:03 +00:00
Hans Petter Selasky
9ae7f7c13c Make sure reserved fields of the EHCI DMA descriptors are not dirty
after previous transfers.

MFC after:	1 week
2014-01-12 13:16:25 +00:00
Hans Petter Selasky
b353507895 Don't do synchronous USB requests inside USB transfer callbacks. It is
technically OK, but not recommended.

MFC after:	1 weeks
2014-01-12 11:44:28 +00:00
Kevin Lo
030dda5d1d Fix a logic error when checking if Tx power entries are greater than 31. 2014-01-11 14:48:16 +00:00
Hans Petter Selasky
67fd1a8fb6 Optimise interrupt logic. Technically writing a zero to the XHCI USB
status register has no effect. Can happen when the interrupt vector is
shared.

MFC after:	1 week
2014-01-11 08:16:31 +00:00
Hans Petter Selasky
13156a5241 Force clearing of event ring interrupts. The "Intel Lynx Point" XHCI
controller found in the MBP2013 has been observed to not work properly
unless this operation is performed.

MFC after:	1 week
Tested by:	Huang Wen Hui <huanghwh@gmail.com>
2014-01-11 08:10:01 +00:00
Hans Petter Selasky
5199761b66 Move USB ID from u3g driver to uhso driver.
Submitted by:	Lundberg, Johannes <johannes@brilliantservice.co.jp>
MFC after:	1 week
2014-01-11 07:53:03 +00:00
Kevin Lo
107f00c0b9 Use m_get2() instead of m_getcl().
Spotted by:	glebius
2014-01-10 14:47:20 +00:00
Kevin Lo
569dfed32c Use m_getcl() instead of MGETHDR/MCLGET macros.
Suggested by:	glebius
2014-01-10 02:47:20 +00:00
Kevin Lo
115ea7c105 Replace deprecated M_DONTWAIT with M_NOWAIT. 2014-01-09 01:48:33 +00:00
Kevin Lo
5945b5f5ab Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
Hans Petter Selasky
d08bc9e548 Check the XHCI event ring regardless of the XHCI status register
value. The "Intel Lynx Point" XHCI controller found in the MBP2013 has
been observed to not always set the event interrupt bit while there
are events to consume in the event ring.

MFC after:	1 week
Tested by:	Huang Wen Hui <huanghwh@gmail.com>
2014-01-07 09:52:26 +00:00
Kevin Lo
7a7e01caa4 Add support for the MediaTek/Ralink RT3593 chipset.
Committed over the ZyXEL NWD2705 on amd64 with WPA.
2014-01-03 06:01:05 +00:00
Hans Petter Selasky
682d7ab884 Minor correction for the XHCI reset logic.
MFC after:	1 week
Found by:	Horse Ma <HMa@wyse.com>
2014-01-02 08:02:57 +00:00
Dimitry Andric
96106c9665 In sys/dev/usb/wlan/if_urtw.c, #if 0 a static const variable, which has
been unused since r198194.

MFC after:	3 days
2013-12-29 20:05:48 +00:00
Kevin Lo
959af34776 Add D-Link DWA-140 rev D1, another RT5372/run(4).
From Anton Mazunin.
2013-12-27 08:03:53 +00:00
Kevin Lo
7dc4b90e74 Some devices have a dual mode such as Tenda W326U and ZyXEL NWD2705,
add the product id and use a standard scsi eject.

Tested on the ZyXEL NWD2705 wlan dongle.
2013-12-24 07:02:05 +00:00
Don Lewis
ccdfa3b5f1 Add quirks to make my old SanDisk Cruzer Mini 128MB happy.
MFC after:	1 week
2013-12-21 03:05:13 +00:00
Kevin Lo
9df3ee0758 Use 'val' instead of 'val & 0xff' since the last argument of run_bbp_write()
is uint8_t.

Spotted by:	yongari
2013-12-18 08:53:40 +00:00
Kevin Lo
fd8fcee579 Fix style: add tab after #define. 2013-12-18 08:39:12 +00:00
Kevin Lo
c48c6bf8fc Fix typo in comment. 2013-12-18 07:47:50 +00:00
Kevin Lo
010b13fa94 Add support to IQ calibration. 2013-12-18 07:34:57 +00:00
Hans Petter Selasky
6f0468df7a Fix regression issue after r259248:
Some Intel XHCI controlles timeout processing so-called "TRBs" when
the final LINK TRB of a so-called "TD" has the CHAIN-BIT set.

MFC after:	1 week
Tested by:	glebius @
2013-12-16 10:50:13 +00:00
Hans Petter Selasky
27ce2fd67c Set chain bit correctly. This will fix some problems sending and
receiving Zero Length Packets, ZLPs. See comment in code for more
information.

MFC after:	1 week
Reported by:	Kohji Okuno <okuno.kohji@jp.panasonic.com>
2013-12-12 08:34:51 +00:00
Hans Petter Selasky
e892b3fe36 USB method structures for USB controllers and USB pipes should be
constant and does not need to be modified. This also saves a small
amount of RAM.
2013-12-11 13:20:32 +00:00
Hans Petter Selasky
468f354b0e Fix typos.
Found by:	remko
2013-12-08 06:52:22 +00:00
Hans Petter Selasky
daab849b2c Fix compilation when the "USB_DEBUG" option is set. 2013-12-06 22:13:51 +00:00
Kevin Lo
242dbae34c Add support for the MediaTek/Ralink RT5572 chipset.
Committed over the TP-LINK TL-WDN3200 (RT5572) on amd64 with WPA.

While here, add my copyright.
2013-12-06 15:26:39 +00:00
Kevin Lo
e0790ad8eb Replace the magic numbers with something more readable. 2013-12-06 15:17:28 +00:00
Kevin Lo
b8161ff3c1 Cosmetic changes. 2013-12-06 15:15:58 +00:00
Kevin Lo
1d66c7a9cf Remove daft KASSERT. 2013-12-06 15:14:18 +00:00
Hans Petter Selasky
563ab08139 Improve the XHCI command timeout recovery handling code.
MFC after:	1 week
2013-12-06 08:42:41 +00:00
Hans Petter Selasky
bce421e9f7 Fix external compiler warning about write-only assigned variable. 2013-12-05 07:18:06 +00:00
Hans Petter Selasky
0aff597a1f Fix what looks like a typo after r258732. 2013-12-04 12:30:51 +00:00
Hans Petter Selasky
8cfe54400e Fix external compiler warning(s). Avoid pointer dereferencing. 2013-12-04 12:07:46 +00:00
Kevin Lo
405886883d The RUN_MAX_TXSZ constat is defined as Tx desc + Tx wireless info + MCLBYTES +
max padding.  We were lucky in that run(4) working fine since both
rt2860_rxwi and rt2860_txwi structure sizes are the same.
2013-12-02 09:07:43 +00:00