Commit Graph

4167 Commits

Author SHA1 Message Date
Adrian Chadd
6bc40d8d83 [run] note that PHY_HT is for mixed mode.
Submitted by:	Ashish Gupta <ashishgu@andrew.cmu.edu>
Differential Revision:	https://reviews.freebsd.org/D25108
2020-06-02 22:37:53 +00:00
Adrian Chadd
bb7234be77 [run] Set the number of HT chains.
* Set the tx/rx chains based on the existing MIMO eeprom reads
* Add 3-chain rates

Tested:

* MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), 2g/5g STA
* MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R), 2g/5g STA
2020-06-02 22:36:17 +00:00
Adrian Chadd
8b05d37a76 [run] Add 11NA flags for 5G NICs that support HT.
Now that I'm a proud owner of an ASUS USB-N66, I can test 2G/5G and
3-stream configurations.

For now, just flip on 5G HT rates.  I've tested this in both
5G HT20 and 5G 11a modes.  It's still one stream for now until
we verify that the number of streams reported (ie the MIMO below)
is actually the number of 11n streams, NOT the number of antennas.
(They don't have to match! You can have more antennas than MIMO
streams!)

Tested:

* run0: MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R)
2020-06-02 16:40:58 +00:00
Adrian Chadd
c775d4ac42 [run] Don't add 11ng channels (2GHz) for RF2020
Don't also add the 11ng channels if we're not in 11n mode or net80211 will
get super weird.
2020-05-30 00:07:42 +00:00
Adrian Chadd
700af579c5 [run] Set ampdu rxmax same as linux; RF2020 isn't an 11n NIC
This is from the linux driver:

* set the ampdu rx max to 32k for 1 stream devics like mine, and
  64k for larger ones
* Don't enable 11n bits for RF2020
2020-05-30 00:06:26 +00:00
Adrian Chadd
f520d76129 [run] Add initial 802.11n support.
* Enable self-generated 11n frames
* add MCS rates for 1-stream and 2-stream rates; will do 3-stream
  once the rest of this tests out OK with other people.
* Hard-code 1 stream for now
* Add A-MPDU RX mbuf tagging
* RTS/CTS if doing RTSCTS in HT protmode as well as legacy; they're
  separate configuration flags
* Update the amrr rate index stuff - walk the rates array like others
  to find the right one - this now works for MCS and CCK/OFDM rates
* Add support for atheros fast frames/AMSDU support as we can generate
  those in net80211.

TODO:

* HT40 isn't enabled yet
* No A-MPDU support just yet; that requires some more firmware research
  and maybe porting some ath(4) A-MPDU support/tracking into net80211
* Short preamble flags aren't set yet for MCS; need to check the linux
  driver and see what's going on there
* Add 3x3 rates and set tx/rx stream configuration appropriately
* More 5GHz testing; I have a 3x3 dual band USB NIC coming soon that'll
  let me test this.
* Figure out why the RX path isn't performing as fast as it could -
  there's only a single buffer loaded at a time for the receive path
  in the USB bulk handler and this may not be super useful.

Tested:

* RT5390 usb, 1x1, RF5370 (2GHz radio), STA mode - A-MSDU TX, A-MPDU RX

Submitted by:	Ashish Gupta <ashishgu@andrew.cmu.edu>
Differential Revision:	https://reviews.freebsd.org/D22840
2020-05-29 15:56:44 +00:00
Hans Petter Selasky
506a911bad Implement helper function, usbd_get_max_frame_length(), which allows kernel
device drivers to correctly predict the default USB transfer frame length.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-05-28 08:38:25 +00:00
Hans Petter Selasky
5e0552018c Don't allow USB device drivers to parent own interface.
It will prevent proper USB device detach.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-05-28 08:05:46 +00:00
Mark Johnston
318825636c rtwn: Add a USB ID for the TP-Link TL-WN727N.
PR:		246417
Submitted by:	Viktor G. <viktor@netgate.com>
MFC after:	1 week
2020-05-12 16:10:07 +00:00
Hans Petter Selasky
f54ab96def Refresh the USB device strings when a USB device is re-enumerated.
Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-05-11 20:55:04 +00:00
Mark Johnston
75c600d287 rtwn: Add a new USB ID.
PR:		246315
Submitted by:	Idwer Vollering <vidwer+fbsdbugs@gmail.com>
MFC after:	1 week
2020-05-09 14:49:56 +00:00
Andriy Gapon
6e32d0e325 usbhid: add several missing usages from Digitizer page
This is applicable to HID in general, not just USB HID.

Inspired by:	wulf
MFC after:	1 week
2020-05-06 15:24:31 +00:00
Hans Petter Selasky
cc224e5381 Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we
don't implement link power management, LPM.

This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0
transactions.

Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-18 15:05:10 +00:00
Emmanuel Vadot
f943f61c08 arm: Fix duplicate ehci DRIVER_MODULE
Name each ehci driver uniquely.
This remove the warning printed at each arm boot :
module_register: cannot register simplebus/ehci from kernel; already loaded from kernel

A similar fix was done in r333074 but imx_ehci wasn't renamed and generic_ehci wasn't
present at that time.
2020-04-16 16:59:37 +00:00
Warner Losh
24ae19c414 Start the retirement process for ufm
This driver hasn't been relevant in almost 15 years. It was for a product on the
shelves for about 6 months in 2003/2004. I've not updated the driver since then,
and have had nobody talk to me about it since maybe 2006 or 2007. It doesn't
implement a standard interface, and can be better done with libusb. All the
action has moved to webcamd for newer, more fully featured hardware. It makes no
appearances in the nycbug dmesg archive.

Relnotes: yes
MFC After: 3 days
2020-04-01 16:22:31 +00:00
Hans Petter Selasky
8e2e5ae7d1 Evaluate modifier keys before the regular keys, so that if a modifier
key is pressed at the same time as a regular key, that means key with
modifier is output. Some automated USB keyboards like Yubikeys need this.

This fixes a regression issue after r357861.

Reported by:	Adam McDougall <mcdouga9@egr.msu.edu>
PR:		224592
PR:		233884
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-30 15:29:39 +00:00
Hans Petter Selasky
d0edc32e72 Add new USB ID.
Submitted by:	Konrad Jopek <kjopek@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D24142
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-22 11:44:24 +00:00
Gavin Atkinson
4b156472c6 Add new USB device ID for Elecom 802.11ac USB device.
MFC after:	2 weeks
2020-03-20 04:13:39 +00:00
Hans Petter Selasky
d76ca5b15c Correctly implement support for remote wakeup for USB 3.0 device.
Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-19 09:15:59 +00:00
Ed Maste
15f16425e4 if_muge: use C99 bool for boolean vars 2020-03-18 14:16:14 +00:00
Hans Petter Selasky
b527d52357 Add new USB device ID to u3g driver.
Submitted by:	super_gromit@hotmail.com
PR:		244798
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-17 09:12:47 +00:00
Alfredo Dal'Ava Junior
5c6ad2e813 atp: fix mouse attachment on PowerBook5,6 (G4)
Skip device mode switch step on Fountain-based devices as they don't
support RAW_SENSOR_MODE command, so failing to attach.

This was reproduced on PowerBook G4 (model PowerBook5,6) equipped with
product ID 0x020e

Reviewed by:	hselasky
Approved by:	jhibbits (mentor)
Differential Revision:	https://reviews.freebsd.org/D24005
2020-03-16 13:53:29 +00:00
Ed Maste
9f6954e505 if_muge: whitespace and style cleanup
Submitted by:	clang-format (in part)
Sponsored by:	The FreeBSD Foundation
2020-03-15 21:47:16 +00:00
Ed Maste
6c0331ea04 muge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE
TSO is independent of checksum offload
2020-03-15 03:32:39 +00:00
Ed Maste
0d5e6868c5 muge: enable RXCSUM as it now works
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-03-15 03:03:01 +00:00
Ed Maste
bec8faad55 muge: correct RX checksum offload
Submitted by:	Johannes <iz-rpi04@hs-karlsruhe.de>
MFC after:	1 week
2020-03-14 01:52:38 +00:00
Vladimir Kondratyev
54c050471c wmt(4): Reapply r358872 (by hselasky) modified to use
maximal input report size instead of wMaxPacketSize.

If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximal input report size as buffer size instead.

PR:		244718
Tested by:	Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf
MFC after:	3 days
Discussed with:	hselasky
2020-03-11 20:05:49 +00:00
Vladimir Kondratyev
b8e3d9b1ed wmt(4): revert r358872 (by hselasky)
Limiting frame size to maximum packet size breaks devices which have input
report size larger than wMaxPacketSize. Maximal input report size should be
used instead.
Revert the commit as it have not been MFC-ed yet.

Discussed with:	hselasky
2020-03-11 19:57:43 +00:00
Hans Petter Selasky
45ddfe6806 If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximum maximum packet size as buffer size instead.

Submitted by:	Oskar Holmlund <oskar.holmlund@ohdata.se>
PR:		244718
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-11 08:16:13 +00:00
Vladimir Kondratyev
c50cdb6319 wmt(4): Fix Synaptics Touch Digitizer V04 attachment
Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage
as constant. That was not supported by descriptor parser.

PR:		232040
Reported by:	Sergei Akhmatdinov <sakhmatd@darkn.space>
MFC after:	1 week
2020-03-09 21:01:22 +00:00
Hans Petter Selasky
601ee53858 Remove the power bit from the super speed root hub port status register
because it clobbers the super speed link status when a device is in super
speed mode. Currently the power bit is not needed for anything in the USB
hub driver.

This fixes USB warm reset for super speed devices.

Tested by:	Shichun.Ma@dell.com
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-08 13:24:34 +00:00
Hans Petter Selasky
0e5670a9a0 Restart the USB keyboard repeat timer at every valid key-press.
This fixes a regression issue after r357861.

Reported by:	James Wright <james.wright@jigsawdezign.com>
PR:	224592
PR:	233884
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-04 09:46:42 +00:00
Hans Petter Selasky
0ba490729b Use hid_get_data_unsigned() instead of hid_get_data() when reading the
key-codes from the USB keyboard. Negative key-codes are currently skipped.

While at it use the bit size value provided by the HID location structure
instead of assuming a value of 8.

This fixes a regression issue after r357861.

Reported by:	Minoru TANABE <kotanabe3@gmail.com>
PR:	224592
PR:	233884
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-02-25 12:56:06 +00:00
Ed Maste
eea248ec9a smsc: remove pre-FreeBSD-10 compat support
Sponsored by:	The FreeBSD Foundation
2020-02-24 19:50:28 +00:00
Ed Maste
fa078712c6 muge: fix rxcsum enable test
if_capabilities indicates capabilities supported by the hardware;
if_capenable which are enabled.  Note that rx checksum is still disabled
in the driver at compile time.

Submitted by:	Johannes <iz-rpi04@hs-karlsruhe.de>
MFC after:	2 weeks
2020-02-24 19:48:29 +00:00
Pawel Biernacki
f8d2b1f3f7 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by:	hselasky, kib
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D23632
2020-02-15 18:52:12 +00:00
Hans Petter Selasky
144d6690b5 Exclude modifier keys from keyboard repeat logic.
This restores USB keyboard driver behaviour prior to r357861.

Requested by:	jkim@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-14 00:29:21 +00:00
Hans Petter Selasky
d4028678f2 Improve USB gaming keyboard support.
Add support for decoding pressed keys as a bitmap. The keys in the
bitmap are described in the interface specific HID descriptor. Some
keyboards even have multiple input interfaces, only using the bitmap
method when the event array is full. That typically means when more
than seven keys are pressed simultaneously.

The internals of the USB keyboard driver have been slightly reworked
to keep track of all keys in a single bitmap having 256 bits. This
bitmap is then divided into blocks of 64-bits as an optimisation.

Simplify automatic key repeat logic, because only the last key pressed
can be repeated.

PR:	224592
PR:	233884
Tested by:	Alex V. Petrov <alexvpetrov@gmail.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-13 16:03:12 +00:00
Hans Petter Selasky
d82c0ebc69 Add USB host controller PCI ID's for Hygon.
Differential Revision:	https://reviews.freebsd.org/D23564
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-10 11:09:56 +00:00
Ed Maste
5aa0576b33 Miscellaneous typo fixes
Submitted by:	Gordon Bergling <gbergling_gmail.com>
Differential Revision:	https://reviews.freebsd.org/D23453
2020-02-07 19:53:07 +00:00
Hans Petter Selasky
21c4082de9 Widen EPOCH(9) usage in USB WLAN drivers.
This patch should unbreak the USB WLAN drivers after r357004.

Pointy hat:	glebius@
Sponsored by:	Mellanox Technologies
2020-01-30 09:41:48 +00:00
Gleb Smirnoff
17c328b6ae Enter the network epoch in USB WiFi drivers when processing input
mbuf queues.

Submitted by:	Idwer Vollering <vidwer gmail.com>
2020-01-24 21:04:33 +00:00
Hans Petter Selasky
540f67be4e Add new USB ID to uslcom(4).
Submitted by:	Oleg Sharoyko <osharoiko@gmail.com>
PR:		243494
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-21 22:28:16 +00:00
Hans Petter Selasky
5bc41c932f Revert r356598 for now because it breaks some AMD based XHCI controllers.
Reported by:	jkim @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-11 11:38:02 +00:00
Hans Petter Selasky
92dfc0fc1d Check the XHCI endpoint state before stopping any endpoint.
This avoids getting the XHCI_TRB_ERROR_CONTEXT_STATE error code from the XHCI
controller when the endpoint is disabled or already stopped.

Suggested by:	Shichun.Ma@dell.com
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-10 09:32:44 +00:00
Hans Petter Selasky
b8ffd2d5d6 Define the XHCI endpoint states.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-10 09:07:43 +00:00
Kyle Evans
acf411aafe dwc_otg: fix fdt attachment for newer bcm2708-usb nodes
The newer versions of RPi FDT flipped the order of the interrupts
specification and added an 'interrupt-names' property for driver aide in
finding the correct interrupt, rather than assuming the positions. Use it if
it's available, or fallback to the old method if there is no interrupt-names
property with a usb value.

This has been tested with both old RPi3B FDT and new RPi3B FDT, USB again
works on the latter.

Reported by:	Tom Yan <tom.ty89 gmail com>
MFC after:	3 days
2020-01-09 19:22:11 +00:00
Hans Petter Selasky
7ba6c62fa0 Fix a XHCI driver issue with Intel's Gemini Lake SOC.
Do not configure any endpoint twice, but instead keep track of which
endpoints are configured on a per device basis, and use an evaluate
endpoint context command instead. When changing the configuration make
sure all endpoints get deconfigured and the configured endpoint mask
is reset.

This fixes an issue where an endpoint might stop working if there is
an error and the endpoint needs to be reconfigured as a part of the
error recovery mechanism in the FreeBSD USB stack.

Tested by:	Shichun.Ma@dell.com
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-09 09:29:24 +00:00
Hans Petter Selasky
6c110e8611 Add own counter for cancelled USB transfers.
Do not count these as errors.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-06 09:49:20 +00:00
Hans Petter Selasky
7082625d97 Make USB statistics per device instead of per bus.
Bump the FreeBSD version due to structure change to
force recompilation of external USB modules.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2019-12-27 20:29:13 +00:00