aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb
Commit message (Collapse)AuthorAgeFilesLines
...
* Fully revert r364379.Hans Petter Selasky2020-09-012-0/+14
| | | | | | | | | | | | | | | The "Intel Sunrise Point-LP USB 3.0 controller" doesn't update the wMaxPacket field in the control endpoint context automatically causing a BABBLE error code on the initial first USB device descriptor read, when the bMaxPacketSize is not 8 bytes. Reported by: wulf@ PR: 248784 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=365029
* rtwn(4): Add support for the Belkin N300.Mark Johnston2020-08-311-0/+1
| | | | | | | | | PR: 249034 Submitted by: Salvador Martínez Mármol <salvica@kapj.net> MFC after: 1 week Notes: svn path=/head/; revision=364993
* Allow slow USB devices to be given more time to return their USB descriptors,Hans Petter Selasky2020-08-281-3/+4
| | | | | | | | | | | like Logitech HD Pro Webcam C920. PR: 248926 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364932
* net80211: enhance getflags*() and ieee80211_add_channel*()Bjoern A. Zeeb2020-08-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For ieee80211_add_channel+*() we are passing in an int flag for ht40 and in some cases another int flag for vht80 where we'd only need two bits really. Convert these variables to a bitflag and fold them together into one. This also allows for VHT160 and VHT80P80 and whatever may come to be considered. Define the various options currently needed. Change the drivers (rtwn and rsu) which actually set this bit to non-0. For convenience the "1" currently used for HT40 is preserved. Enahnce getflags_5ghz() to handle the full set of VHT flags based on the input flags from the the driver. Update the regdomain implementation as well to make use of the new flags and deal with higher [V]HT bandwidths. ieee80211_add_channel() specifically did not take flags so it will not support naything beyond 20Mhz channels. Note: I am not entirely happy with the "cbw_flag[s]" name, but we do use chan_flags elsewhere already. MFC after: 2 weeks Reviewed by: adrian, gnn Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential revision: https://reviews.freebsd.org/D26091 Notes: svn path=/head/; revision=364673
* Fix regression after r364379.Hans Petter Selasky2020-08-201-3/+1
| | | | | | | | | | | | | | | The AMD's Ryzen 3 3200g XHCI controllers apparently need the evaluate control endpoint context command, but we don't need to issue this command when the bMaxPacketSize is received after the read of the USB device descriptor, because this part should be handled automatically. PR: 248784 Tested by: emaste, hselasky MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364433
* Remove the long obsolete ufm driver.Warner Losh2020-08-201-340/+0
| | | | | | | | | | | | | It was a driver for a USB FM tuner that was available in the market in 2002. I wrote the driver in 2003. I've not used it since 2005 or so, so it's time to retire this driver. No userland code ever interfaced to the special device it created. There's no user base: the last bug I received on this driver was in 2004. Relnotes: Yes Notes: svn path=/head/; revision=364432
* Avoid evaluating the XHCI control endpoint context.Hans Petter Selasky2020-08-192-15/+3
| | | | | | | | | | | | | | The XHCI specification says that the XHCI controller should detect reception of the USB device descriptors, and automatically update the max packet size in the control endpoint context. Differential Revision: https://reviews.freebsd.org/D26104 Reviewed by: kp@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364379
* Check the XHCI endpoint state before issuing XHCI endpoint commands.Hans Petter Selasky2020-08-181-10/+36
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D26064 Reviewed by: kp@ and bz@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364347
* cp2112: a number of cleanups and improvementsAndriy Gapon2020-08-121-301/+379
| | | | | | | | | | | | | | | | | | | | - hoist all request / response structures from function level to top level - replace magic numeric literals with constants - regroup types, data and functions - remove setting of the id field in responses as they are completely overwritten with data from the device - centralize setting of the id field as it is always set to the value of request type - fix setting and querying of open-drain vs push-pull configuration of an output pin -- it's always in one of those configurations - detect special pin configurations: a pin in a special configuration is neither general purpose input or output - there is still no support for setting special configurations MFC after: 2 weeks Notes: svn path=/head/; revision=364143
* cp2112: driver for the namesake GPIO and I2C master gadgetAndriy Gapon2020-08-061-0/+1381
| | | | | | | | | | | | | | | | | | | | | | | | | | Documentation: - CP2112 Datasheet https://www.silabs.com/documents/public/data-sheets/cp2112-datasheet.pdf - AN495: CP2112 Interface Specification https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf - CP2112 Errata https://www.silabs.com/documents/public/errata/cp2112-errata.pdf The logic is implemented as three sub-drivers. The parent driver claims the USB device and creates two child devices. One acts as a GPIO controller and the other is an I2C controller. Tested with CP2112 revision F02. Both features seem to work. HTU21 sensor was used as an I2C slave. Reviewed by: adrian, hselasky MFC after: 2 weeks Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D25359 Notes: svn path=/head/; revision=363951
* Add new USB ID.Hans Petter Selasky2020-08-061-0/+4
| | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=363950
* Handle Raspberry Pi 4 xhci firmware loading.Andrew Turner2020-08-032-8/+7
| | | | | | | | | | | | | The newer hardware revisions of the Raspberry Pi 4 removed the ability of the VIA VL805 xhci controller to load its own firmware. Instead the firmware must be installed at the appropriate time by the VideoCore coprocessor. Submitted by: Robert Crowston <crowston_protonmail.com> Differential Revision: https://reviews.freebsd.org/D25261 Notes: svn path=/head/; revision=363795
* clean up whitespace...John-Mark Gurney2020-07-252-24/+24
| | | | Notes: svn path=/head/; revision=363531
* usb(4): Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-2210-43/+12
| | | | | | | | | | | | | | Handle the fact that parts of usb(4) can be compiled into the boot loader, where M_WAITOK does not guarantee a successful allocation. PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> (original version) Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25706 Notes: svn path=/head/; revision=363420
* Add dwc_otg_acpiAndrew Turner2020-06-303-26/+215
| | | | | | | | | | | | | | Create an acpi attachment for the DWC USB OTG device. This is present in the Raspberry Pi 4 in the USB-C port normally used to power the board. Some firmware presents the kernel with ACPI tables rather than FDT so we need an ACPI attachment. Submitted by: Greg V <greg_unrelenting.technology> Approved by: hselasky (removal of All rights reserved) Differential Revision: https://reviews.freebsd.org/D25203 Notes: svn path=/head/; revision=362803
* rtwn: Add a USB ID for Buffalo WI-U2-433DHPLi-Wen Hsu2020-06-271-0/+1
| | | | | | | | | PR: 247573 Submitted by: HATANO Tomomi <hatanou@infolab.ne.jp> MFC after: 1 week Notes: svn path=/head/; revision=362672
* [rsu] Update wme ie API use.Adrian Chadd2020-06-161-1/+1
| | | | | | | Whoops, forgot to land this one too! Notes: svn path=/head/; revision=362213
* Add missing range checks when receiving USB ethernet packets.Hans Petter Selasky2020-06-113-8/+33
| | | | | | | | | Found by: Ilja Van Sprundel, IOActive MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=362056
* USB HID descriptors may push/pop the current state to allowHans Petter Selasky2020-06-051-26/+26
| | | | | | | | | | | | | | | | | | description of items residing in a so-called union. FreeBSD currently only supports 4 such pop levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=361827
* [run] Fix up tx/rx frame size.Adrian Chadd2020-06-032-4/+6
| | | | | | | | | | | | | This specifically fixes that TX frames are large enough now to hold a 3900 odd byte AMSDU (the little ones); me flipping it on earlier messed up transmit! Tested: * if_run, STA mode, TX/RX TCP/UDP iperf. TCP is now back to normal and correctly does ~ 3200 byte AMSDU/fast frames (2x1600ish byte MSDUs). Notes: svn path=/head/; revision=361778
* [run] note that PHY_HT is for mixed mode.Adrian Chadd2020-06-022-2/+2
| | | | | | | | Submitted by: Ashish Gupta <ashishgu@andrew.cmu.edu> Differential Revision: https://reviews.freebsd.org/D25108 Notes: svn path=/head/; revision=361738
* [run] Set the number of HT chains.Adrian Chadd2020-06-021-7/+14
| | | | | | | | | | | | | * 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 Notes: svn path=/head/; revision=361737
* [run] Add 11NA flags for 5G NICs that support HT.Adrian Chadd2020-06-021-0/+2
| | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=361726
* [run] Don't add 11ng channels (2GHz) for RF2020Adrian Chadd2020-05-301-2/+2
| | | | | | | | Don't also add the 11ng channels if we're not in 11n mode or net80211 will get super weird. Notes: svn path=/head/; revision=361637
* [run] Set ampdu rxmax same as linux; RF2020 isn't an 11n NICAdrian Chadd2020-05-301-13/+26
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=361636
* [run] Add initial 802.11n support.Adrian Chadd2020-05-293-41/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 Notes: svn path=/head/; revision=361626
* Implement helper function, usbd_get_max_frame_length(), which allows kernelHans Petter Selasky2020-05-282-0/+78
| | | | | | | | | | device drivers to correctly predict the default USB transfer frame length. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=361581
* Don't allow USB device drivers to parent own interface.Hans Petter Selasky2020-05-281-1/+1
| | | | | | | | | | It will prevent proper USB device detach. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=361577
* rtwn: Add a USB ID for the TP-Link TL-WN727N.Mark Johnston2020-05-121-0/+1
| | | | | | | | | PR: 246417 Submitted by: Viktor G. <viktor@netgate.com> MFC after: 1 week Notes: svn path=/head/; revision=360966
* Refresh the USB device strings when a USB device is re-enumerated.Hans Petter Selasky2020-05-113-71/+110
| | | | | | | | | Submitted by: Horse Ma <Shichun.Ma@dell.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=360925
* rtwn: Add a new USB ID.Mark Johnston2020-05-091-1/+2
| | | | | | | | | PR: 246315 Submitted by: Idwer Vollering <vidwer+fbsdbugs@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=360848
* usbhid: add several missing usages from Digitizer pageAndriy Gapon2020-05-061-0/+3
| | | | | | | | | | This is applicable to HID in general, not just USB HID. Inspired by: wulf MFC after: 1 week Notes: svn path=/head/; revision=360692
* Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because weHans Petter Selasky2020-04-181-17/+0
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=360075
* arm: Fix duplicate ehci DRIVER_MODULEEmmanuel Vadot2020-04-162-4/+4
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=360013
* Start the retirement process for ufmWarner Losh2020-04-011-0/+1
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=359521
* Evaluate modifier keys before the regular keys, so that if a modifierHans Petter Selasky2020-03-301-3/+17
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=359439
* Add new USB ID.Hans Petter Selasky2020-03-221-0/+1
| | | | | | | | | | Submitted by: Konrad Jopek <kjopek@gmail.com> Differential Revision: https://reviews.freebsd.org/D24142 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=359209
* Add new USB device ID for Elecom 802.11ac USB device.Gavin Atkinson2020-03-201-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=359158
* Correctly implement support for remote wakeup for USB 3.0 device.Hans Petter Selasky2020-03-192-6/+52
| | | | | | | | | Submitted by: Horse Ma <Shichun.Ma@dell.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=359120
* if_muge: use C99 bool for boolean varsEd Maste2020-03-181-5/+7
| | | | Notes: svn path=/head/; revision=359070
* Add new USB device ID to u3g driver.Hans Petter Selasky2020-03-172-0/+4
| | | | | | | | | | Submitted by: super_gromit@hotmail.com PR: 244798 MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=359031
* atp: fix mouse attachment on PowerBook5,6 (G4)Alfredo Dal'Ava Junior2020-03-161-5/+9
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=359015
* if_muge: whitespace and style cleanupEd Maste2020-03-151-22/+16
| | | | | | | | Submitted by: clang-format (in part) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=359009
* muge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLEEd Maste2020-03-151-2/+2
| | | | | | | TSO is independent of checksum offload Notes: svn path=/head/; revision=359007
* muge: enable RXCSUM as it now worksEd Maste2020-03-151-6/+2
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=359006
* muge: correct RX checksum offloadEd Maste2020-03-141-2/+3
| | | | | | | | Submitted by: Johannes <iz-rpi04@hs-karlsruhe.de> MFC after: 1 week Notes: svn path=/head/; revision=358979
* wmt(4): Reapply r358872 (by hselasky) modified to useVladimir Kondratyev2020-03-111-7/+11
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=358895
* wmt(4): revert r358872 (by hselasky)Vladimir Kondratyev2020-03-111-1/+1
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=358892
* If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controllerHans Petter Selasky2020-03-111-1/+1
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=358872
* wmt(4): Fix Synaptics Touch Digitizer V04 attachmentVladimir Kondratyev2020-03-091-3/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=358824