aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-066-11/+9
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* kern: Make fileops and filterops tables const where possibleMark Johnston2024-11-261-2/+2
| | | | | | No functional change intended. MFC after: 1 week
* rtwn: Add device ID for TPLink RTL8192CUAugustin Cavalier2024-11-211-0/+1
|
* uath: flush data/commands to the firmware before changing channel / stateAdrian Chadd2024-11-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver wasn't stable - it would start fine, but during scan it would eventually hang and no further command endpoint transfers would complete. After adding some debugging and looking at the logs I noticed that things went sideways once a /data/ frame was sent. The channel change config happened between the data frame being sent and being completed. My guess is that the firmware doesn't like a channel change and reset whilst there's pending data frames. Checking the Linux driver I found that it was doing a flush before a channel change, and we're doing it afterwards. This acts like a fence around ensuring scheduled TX work has completed. In net80211 the transmit path and the control path aren't serialised, so it's very often the case that ioctls, state changes, etc occur whilst in parallel there are frame transmits being scheduled. This seems to happen more frequently on a more recent, high core (8) machine with XHCI. I remember testing this driver years ago on single and dual core CPU laptops with no problems. So, add some flushes - before a channel change, and during a transition to AUTH when the BSS config is being programmed into the firmware. These two fences seem enough to reliably associate as a 2GHz and 5GHz STA. Note that this isn't entirely blocking all newly queued transmit work from occuring until after the NIC has finished configuration. That will need some further investigation. Locally tested: * Wistron NuWeb AR5523 dual-band NIC, STA mode, 2/5GHz Differential Revision: https://reviews.freebsd.org/D47655
* usb: fix the ID for the dual-band Wistron AR5523 USB NICAdrian Chadd2024-11-192-1/+3
| | | | | | | | | | | | | | | | | | | Use the correct ID, as I have one of these NICs. Add the previous one back in case it's out there in the wild. @emaste did a bit of a dig into the product numbers. @sam did change the ID from 0x0828 -> 082a in a commit a long while back. It's worth reading the code review for further details. However, I do have one of these NICs and I verified that it indeed has the given ID, and with some follow-up work to fix some race conditions, it works fine in 2GHz 11bg and 5GHz 11a operation. Differential Revision: https://reviews.freebsd.org/D47654 Obtained from: Linux, drivers/net/wireless/ath/ar5523/ar5523.c
* uhid(4): update ugd_actlen in USB_GET_REPORT ioctlMatthew Nygard Dodd2024-11-181-1/+3
| | | | | | | | | USB_GET_REPORT ioctl is documented to update ugd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week
* net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macrosAdrian Chadd2024-11-176-20/+7
| | | | | | | | | | | | | * Add macros for the management and control frame type checks that I've come across in the drivers. * Delete some now old code (eg ath's ieee80211_is_action()) as there's now a macro for it. Local testing: * not yet, I have a lot of wifi devices to find and test against Differential Revision: https://reviews.freebsd.org/D47500
* usb: Add support for Brainboxes USB-to-Serial adaptersHajimu UMEMOTO2024-11-112-0/+36
| | | | | PR: 277482 Reported by: Cameron Williams
* usb: fix loop in usb_config_parseEd Maste2024-11-111-0/+1
| | | | | | | | | | By inspection, index increment was missing. PR: 281843 Reported by: Matt Jacobson Reviewed by: bz, markj Fixes: e4611d26265f ("usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting.") Sponsored by: The FreeBSD Foundation
* ukbd: Enable ukbd_apple_swap for all Apple ISO keyboardsFrank Hilgendorf2024-11-072-6/+108
| | | | | | | | | | | | | | Key code swapping between [<>] and [^°] key is enabled for all Apple ISO type keyboards. Before, swapping was enabled when the Eject key was detected in HID usage. This did not correlate well with the swapped keys presence. usbdevs file is extended by several Apple keyboard models to support ISO model identification. Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1506
* usb: change LIST to SLIST to avoid LinuxKPI conflictsBjoern A. Zeeb2024-09-245-13/+13
| | | | | | | | | | | | | In order to better integrate modern LinuxKPI USB this tries to reduce a contention point of "LIST". Given there is no need to use a LIST here change it to SLIST to avoid conflicts. It is a workaround which does not solve the actual problem (overlapping namespaces) but it helps us a lot for now. Sponsored by: The FreeBSD Foundation X-MFC? unclear Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46534
* if_usie: fix typoKristof Provost2024-09-211-1/+3
| | | | | | | Fix a 'case AF_INET;' typo, and ensure we include 'opt_inet6.h' so #ifdef INET6 actually works. Sponsored by: Rubicon Communications, LLC ("Netgate")
* u3g: reorder Quectel devices by product IDFranco Fichtner2024-09-212-10/+10
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1410
* ure(4): Add ID for LAN port in Thinkpad OneLink+ dockAlexander Motin2024-09-192-0/+2
| | | | | | That's a pretty old dock for Thinkpad X1 Carbon Gen4 and few others. MFC after: 1 week
* wsp: Use already-calculated distance of fingers for comparison.Joshua Rogers2024-09-061-3/+1
| | | | | | | | | Also correctly use tun.max_double_tap_distance for maximum distance of fingers for vertical scrolling. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365
* wsp: Improve multi-finger touchpad usage and allow more configurationsJoshua Rogers2024-09-061-29/+56
| | | | | | | | | | | | | | | | | | | | This patch allows scrolling with multiple fingers simultaneously, in line with how wsp trackpads function on MacOS. Two new tunables are added: hw.usb.wsp.max_finger_area and hw.usb.wsp.max_double_tap_distance. max_finger_area defines the maximum size which the driver registered an object on trackpad as a finger. Previously, this value was hardcoded as 1200, which was too low to register thumb-clicks. max_double_tap_distance defines the maximum distance between two fingers which will register as a double-click. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365
* wsp: Allow the trackpad to be used after a partially unreleased click.Joshua Rogers2024-09-061-2/+8
| | | | | | | | | | This provides functionality for a click which is partially unreleased and then allows the user to continue moving the mousepad as if were not invoked as a full click Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365
* usb: increase USB_PORT_RESET_RECOVERYAhmad Khalifa2024-09-061-1/+1
| | | | | | | | 10ms seems to be too strict for some configurations, so increase to 20ms. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1327
* u3g: add SIERRA AC340UFranco Fichtner2024-08-302-0/+2
| | | | | Pull request: https://github.com/freebsd/freebsd-src/pull/1397 MFC after: 3 days
* usb: correct the rtw8821cu quirk and add another wireless rtw88 deviceBjoern A. Zeeb2024-08-272-1/+2
| | | | | | | | | | | | | | | The RTW8821CU_CD entry in quirks has an invalid lo_rev/hi_rev match entry. Use the different USB_QUIRK macro to match on all of these; the value we currently see is 0x0200 on two different wifi sticks. [1] Also add an entry for the DLINK DWA-181 rev A1, rtw88 USB. Submitted by: phk Tested by: phk Fixes: b3b6a959c85af3aabbde3ef2b80dbd4bf5b6f5a7 [1] Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46189
* Move support of Realtek 8156/8156B from cdce(4) to ure(4)Li-Wen Hsu2024-08-123-3/+1
| | | | | | | Reviewed by: kevlo, imp, hrs MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45088
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-2519-21/+21
| | | | Sponsored by: Netflix
* net80211: migrate the group/unicast key check into inline functionsAdrian Chadd2024-07-152-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The way that net80211 and drivers are checking for the /type/ of key is to check if it's in the vap WEP key array and if so, it's a group key. If not, it's a unicast key. That's not only kind of terrible, but it's also going to be problematic with future 802.11 support (for multiple unicast keys and IGTK keys for management frame protection.) So as part of this, remove the places where this is done and instead use a pair inline functions - ieee80211_is_key_global() and ieee80211_is_key_unicast(). They currenly still use the same logic but the drivers and net80211 stack isn't doing it itself. There are still open questions about why keys are not being correctly tagged as GROUP, GTK, PTK, etc. That will be investigated and addressed in follow-up work as a pre-cursor to MFP, IGTK, etc. as mentioned above. Testing: * iwn, rtwn - STA mode Differential Revision: https://reviews.freebsd.org/D45516
* if_urndis: Organize buffer layouts more naturallyMark Johnston2024-07-091-11/+11
| | | | | | | | | | | | | | | | | | | | - Group the request header and I/O buffer in one structure, rather than assuming that both request structures have the same size. - Pass a pointer to the whole structure to urndis_ctrl_query() and urndis_ctrl_set() rather than just the header. Otherwise, on CHERI platforms, these functions violate subobject bounds since they modify the buffer following the header. While here, there is no apparent reason for the request structure used in urndis_attach() to be allocated statically. Change it so that it's allocated on the stack. No functional change intended. Reviewed by: jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D45866
* ums(4): fix incorrect mouse button reporting via evdevNiko Sonack2024-07-021-2/+3
| | | | | | | | | | when ums driver receives non-mouse HID report. This results in unexpected button release event. Reuse existing sysmouse logic to keep button pressed. Reviewed by: imp, wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45838
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-284-20/+0
| | | | | | | | | | | Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
* Add some AMD device IDs.Dmitry Luhtionov2024-06-071-0/+3
|
* u3g: Add support for SIM7600GMaxime Thiebaut2024-06-062-0/+2
| | | | | Signed-off-by: Maxime Thiebaut <maxime+freebsd@thiebaut.dev> Reviewed by: kp
* kern: Remove leftover saf1761otg bitsJoshua Kinard2024-06-031-1/+0
| | | | | | | | | | | | Almost all code related to the saf1761 driver was removed in commit 44796b7e822e, except for two small bits related to saf1761otg support. This patch completes the removal. PR: 279302 Signed-off-by: Joshua Kinard <freebsd@kumba.dev> Reviewed by: mhorne MFC after: 3 days Fixes: 44796b7e822e ("mips: remove saf1761")
* Add a new USB ID for Xiaomi mini USB WiFiKevin Lo2024-05-311-0/+4
|
* usb: Remove uneeded revision verbosity from quirks listAhmad Khalifa2024-05-111-434/+382
| | | | | | | | | | | | Seperate usb quirks that target specific revisions from those that dont. Alot of the quirks dont use lo_rev and hi_rev, so we can abstract the 0x0000, 0xffff into a macro. [[ This commit is a bit more churn than we like. I carefully reviewed each one and they are all good. The end product is better -- imp ]] Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1153
* usb: Fix quirks listAhmad Khalifa2024-05-112-27/+19
| | | | | | | | | | | In some cases, the USB_QUIRK_VP macro was being misused. Instead of setting quirks to the intended value, the first two supplied quirks would go into lo_rev and hi_rev. Replace it with USB_QUIRK_VO which only takes the needed args. This also makes the Dummy products, which where being used to correctly set vendor only quirks, not necessary. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1153
* smsc(4): update to mention MicrochipEd Maste2024-05-081-2/+2
| | | | | | | | | | | Microchip Technology acquired SMSC in 2012, and all current products and datasheets refer to the devices supported by this driver as Microchip parts. Mention SMSC in a parenthetical comment to explain the driver's name. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45115
* usb(4): Remove a double word in a source code commentGordon Bergling2024-04-201-1/+1
| | | | | | - s/of of/of/ MFC after: 3 days
* Add support for i2c-tiny-usb: usb to iic bridgeDenis Bodor2024-04-191-0/+302
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1123
* muge(4): Fix a typo in a source code commentGordon Bergling2024-04-181-1/+1
| | | | | | - s/addres/address/ MFC after: 3 days
* bcm2838_xhci: add moduleLexi Winter2024-04-101-0/+2
| | | | | | | | | | | | | | | | | | | | | bcm2838_xhci(4) is a shim for the XHCI controller on the Raspberry Pi 4B SoC. It loads the controller's firmware before passing control to the normal xhci(4) driver. When xhci(4) is built as a module (and not in the kernel), bcm2838_xhci is not built at all and the RPi4's XHCI controller won't attach due to missing firmware. To fix this, build a new module, bcm2838_xhci.ko, which depends on xhci.ko. For the dependency to work correctly, also modify xhci to provide the 'xhci' module in addition to the 'xhci_pci' module it already provided. Since bcm2838_xhci is specific to a quirk of the RPi4 SoC, only build the module for AArch64. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1142
* uath(4): Fix a typo in a source code commentGordon Bergling2024-02-221-1/+1
| | | | | | - s/parmeter/parameter/ MFC after: 3 days
* umcs(4): Fix two typos in source code commentsGordon Bergling2024-02-221-2/+2
| | | | | | - s/frequences/frequencies/ MFC after: 3 days
* ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driverAndriy Gapon2024-02-191-4/+2
| | | | | | | | | | | | Previosuly, USB_IFACE_DRIVER_ACTIVE would report that the driver is active even after it detached. That's because a device(9) still remains. So, add device_is_alive(9) check for more accurate reporting. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43960
* net80211: deal with lost state transitionsBjoern A. Zeeb2024-02-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 5efea30f039c4 we can possibly lose a state transition which can cause trouble further down the road. The reproducer from 643d6dce6c1e can trigger these for example. Drivers for firmware based wireless cards have worked around some of this (and other) problems in the past. Add an array of tasks rather than a single one as we would simply get npending > 1 and lose order with other tasks. Try to keep state changes updated as queued in case we end up with more than one at a time. While this is not ideal either (call it a hack) it will sort the problem for now. We will queue in ieee80211_new_state_locked() and do checks there and dequeue in ieee80211_newstate_cb(). If we still overrun the (currently) 8 slots we will drop the state change rather than overwrite the last one. When dequeing we will update iv_nstate and keep it around for historic reasons for the moment. The longer term we should make the callers of ieee80211_new_state[_locked]() actually use the returned errors and act appropriately but that will touch a lot more places and drivers (possibly incl. changed behaviour for ioctls). rtwn(4) and rum(4) should probably be revisted and net80211 internals removed (for rum(4) at least the current logic still seems prone to races). PR: 271979, 271988, 275255, 263613, 274003 Sponsored by: The FreeBSD Foundation (in 2023) MFC after: 3 days Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43389
* usbdevs: add Ralink RT7601 aka MT7601Andriy Gapon2024-01-281-0/+1
| | | | | This is a popular USB WiFi chip. Unfortunately, it's not supported by FreeBSD yet.
* usb: Fix a typo in a source code commentGordon Bergling2024-01-221-1/+1
| | | | | | - s/recevied/received/ MFC after: 3 days
* usb: Fix two typos in source code commentsGordon Bergling2024-01-202-2/+2
| | | | | | | - s/bascially/basically/ - s/assistence/assistance/ MFC after: 3 days
* usb: use only usb_devinfo() in device_set_usb_desc()Christos Margiolis2024-01-161-25/+1
| | | | | | | | | | | | device_set_usb_desc() first tries to fetch device information through the iInterface descriptor, otherwise it falls back to usb_devinfo(). Since usb_devinfo() is both guaranteed to work, and is more verbose, get rid of the initial iInterface attempt. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D43383
* syscon: Move syscon code in dev/sysconEmmanuel Vadot2024-01-102-2/+2
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43196
* phy: Move phy code in dev/phyEmmanuel Vadot2024-01-109-12/+12
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: emaste, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43195
* regulator: Move regulator code in dev/regulatorEmmanuel Vadot2024-01-101-1/+1
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: emaste, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43194
* hwreset: Move reset code in dev/hwresetEmmanuel Vadot2024-01-106-6/+6
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43192
* clk: Move clock code in dev/clkEmmanuel Vadot2024-01-108-8/+8
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43191