aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/net
Commit message (Collapse)AuthorAgeFilesLines
* usb: Kill left-over cdefs.h includesWarner Losh2025-03-1115-15/+0
| | | | | | | | | | | These includes were for __FBSD_RCSID() macro. They weren't formatted like the rest of the tree so weren't trimmed automatically when that script was run. Trim them now. MFC After: 1 week Sponsored by: Netflix (cherry picked from commit ca48e43ba9ee73a07cdbad8365117793b01273bb)
* ure(4): Add support for ELECOM EDC-QUA3CFUKAUMI Naoki2025-02-071-0/+1
| | | | | | | | | | | | | | | | ELECOM EDC-QUA3C is a USB3.1 Gen1 Type-A/C 2.5GBASE-T network adapter. This also works as a cdce(4) device by: usbconfig -d X.Y set_config 1 or usbconfig -d X.Y set_config 2 Signed-off-by: FUKAUMI Naoki <naoki@radxa.com> MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1578 (cherry picked from commit dc273058cb0b6bef075e77272afc66f1a1fd3889)
* Move support of Realtek 8156/8156B from cdce(4) to ure(4)Li-Wen Hsu2024-10-212-2/+1
| | | | | | | | | Reviewed by: kevlo, imp, hrs MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45088 (cherry picked from commit 6ea4d95f6c76aa64d2db5c04c87e68dc299544df)
* ure(4): Add ID for LAN port in Thinkpad OneLink+ dockAlexander Motin2024-09-261-0/+1
| | | | | | | | That's a pretty old dock for Thinkpad X1 Carbon Gen4 and few others. MFC after: 1 week (cherry picked from commit a1bb5bdb0ab69bc3ce1f6051b6abc0cbaab83faa)
* if_urndis: Organize buffer layouts more naturallyMark Johnston2024-07-231-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 (cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e)
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-07-123-14/+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 (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
* smsc(4): update to mention MicrochipEd Maste2024-05-101-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 (cherry picked from commit 7ef6ce51742d44a7375ccbaeda4cc64e034c4816)
* muge(4): Fix a typo in a source code commentGordon Bergling2024-04-211-1/+1
| | | | | | - s/addres/address/ (cherry picked from commit 046fe202e76623988ac612b20047940b86dd373f)
* Teach if_smsc to get MAC from bootargs.Ronald Klop2023-12-281-3/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | Some Raspberry Pi pass smsc95xx.macaddr=XX:XX:XX:XX:XX:XX as bootargs. Use this if no ethernet address is found in an EEPROM. As last resort fall back to ether_gen_addr() instead of random MAC. (cherry picked from commit 3878bbf1bb9e68f8579b57cde7d4e5c77de93320) if_smsc: fix build on armv6 & armv7 compile error was: /usr/src/sys/dev/usb/net/if_smsc.c:1597:40: error: format specifies type 'unsigned long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat] "failed alloc for bootargs (%lu)", len); ~~~ ^~~ %zd (cherry picked from commit 8a0ee306227a17a998bdc7af2275fd94b9164342) PR: 274092 Reported by: Patrick M. Hausen (via ML) Reviewed by: imp, karels, zlei Tested by: Patrick M. Hausen Approved by: karels Relnotes: yes Differential Revision: https://reviews.freebsd.org/D42463
* axge: Add support for AX88179ADamien Broka2023-10-112-8/+38
| | | | | | | | | | | | | | | The AX88179A has two firmware modes, one of which is backward compatible with existing AX88178A/179 driver. The active firmware mode can be controlled through a register. Update axge(4) man page to mention 179A support and ensure that, when bound to a AX88179A, the driver activates the compatible firmware mode. Reviewed by: markj Pull Request: https://github.com/freebsd/freebsd-src/pull/854 MFC after: 1 week (cherry picked from commit 6962da914dd511349b219241e92b32329be76fc6)
* axge: Skip dummy packet headersDamien Broka2023-09-241-1/+18
| | | | | | | | | | | | | | | | | Newer versions of the AX88179 interweave dummies alongside valid packet headers in bulk IN transfer data. This was probably done for backward compatibility with existing drivers. However current driver records these dummy headers as dropped frames, leading to stats misreporting one Ierr per Ipkt. This skips those dummy headers silently, thereby not generating Ierrs for them. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/842 (cherry picked from commit 70fbcd451b68b7f6038d8a602cd8d5e1bb890f1d)
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1619-38/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-168-8/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1614-28/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* ure(4): add support for Thinkpad Hybrid USB-C with USB-A dockJoerg Pulz2023-07-041-0/+1
| | | | | | | | | | | Add support for LAN port found on Thinkpad Hybrid USB-C with USB-A dock. While here fix a small typo - s/UBS/USB/ Sponsored by: Technical University of Munich Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/791
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1218-18/+18
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* if_mos: Remove set but unused variable.John Baldwin2023-04-101-3/+0
| | | | | | Reviewed by: hselasky Reported by: GCC Differential Revision: https://reviews.freebsd.org/D39356
* Mechanically convert usb ethernet drivers to DrvAPIJustin Hibbits2023-03-0618-517/+509
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37812
* usb: Remove unused member in struct mos_softcZhenlei Huang2023-02-151-1/+0
| | | | | | | | Spotted by jhibbits in D37812. Reviewed by: #network, glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38581
* Mechanically convert usb_ethernet(4) to IfAPIJustin Hibbits2023-02-072-48/+47
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37802
* usb: add support for Huawei E5573Cs322Michael Paepcke2023-02-041-1/+2
| | | | | | | | | | | | | | | | | | | | Switch the now added E5573Cs322_ECM (0x14db) as well per default to NCM. With this patch we default all devices to simple NCM mode to avoid the problem and get a consistent reliable behavior. No matter what firmware version and provider mix are involved. Rationale: Even the bigger SOC shows under complex load in ECM (double-nat) mode the same performance drop from 25Mbit to 2Mbit Line Speed, similar to E3372h. Reason: Thermal problems (reported via serial debug interface in ACM Mode) after 2-3 minutes load. Fix the root cause and bundle a working firmware is out of reach because Huawei sells the same hardware, different (crippled) firmware versions at different price points in different markets as strategy. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633
* usb: add new scsi_huawei eject3 & eject4 driver supportMichael Paepcke2023-02-041-0/+2
| | | | | | | | | | | | | Add initialization for new Huawei 4G E3372_NCM, E3372v153_NCM, E5573Cs322_NCM, E5573Cs322_ECM, and E5573Cs322_ACM. Remove now-obsolete Huawei 3G E3131 init sequence. These devices are obsolete, share IDs with new devices and the 3G networks are shutdown. These old devices work correctly via the 4G code while still allowing the shared IDs to work differently for the new devices. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633
* Add Windows Dev Kit 2023 support to if_ureAndrew Turner2023-01-041-0/+1
| | | | | | | | | The Windows Dev Kit 2023 has an if_ure NIC with custom vendor and procuct IDs. Add them to the driver. Tested by: Robert Clausecker <fuz@fuz.su> Obtained from: OpenBSD Sponsored by: Arm Ltd
* usb(4): Substitute "unsigned int" using the equivalent and shorter ↵Hans Petter Selasky2022-10-075-14/+14
| | | | | | | "unsigned" keyword. MFC after: 1 week Sponsored by: NVIDIA Networking
* Revert "usb: Remove a double words in a source code comments"Gordon Bergling2022-09-052-2/+2
| | | | | | | | This reverts commit 8ca67bf1273a5168f8a3787183159c477632e582. The original comment was correct; changing it loses a key part. Reported by: jrtc27
* usb: Remove a double words in a source code commentsGordon Bergling2022-09-042-2/+2
| | | | | | - s/that that/that/ MFC after: 3 days
* usb: Fix two typos in source code commentsGordon Bergling2022-09-032-2/+2
| | | | | | - s/overriden/overridden/ MFC after: 3 days
* USB id of yet another Lenovo USB-C ethernet dongle.Poul-Henning Kamp2022-08-281-0/+1
|
* usb: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-0618-52/+18
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-069-9/+9
|
* usb: Add a __usbdebug_used for variables only used under #ifdef USB_DEBUG.John Baldwin2022-04-131-1/+1
| | | | | Use it for various variables only used in DPRINTF debug traces conditional on USB_DEBUG.
* usb(4): Fix two typos in source code commentsGordon Bergling2022-04-092-2/+2
| | | | | | - s/negotation/negotiation/ MFC after: 3 days
* mgue: eliminate write only variables ret, err and errorWarner Losh2022-04-051-13/+9
| | | | Sponsored by: Netflix
* cdce: Fix a -Wunused-but-set-variable warningMark Johnston2022-02-281-2/+1
| | | | MFC after: 1 week
* axe: Fix a -Wunused-but-set-variable warningMark Johnston2022-02-281-3/+0
| | | | MFC after: 1 week
* axge: Fix a -Wunused-but-set-variable warningMark Johnston2022-02-281-2/+0
| | | | MFC after: 1 week
* Create wrapper for Giant taken for newbusWarner Losh2021-12-106-15/+14
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* cdceem(4): Fix "set but not used" warningsEdward Tomasz Napierala2021-11-291-6/+5
| | | | | | No functional changes. Sponsored By: EPSRC
* smsc(4): Fix a typo in a commentGordon Bergling2021-10-021-1/+1
| | | | | | - s/setings/settings/ MFC after: 3 days
* if_cdce: Add support for setting RX filteringKornel Duleba2021-09-012-4/+52
| | | | | | | | | | | | | | | | | | | | | We can now set promisc and allmulti modes. Filtering of given multicast addresses is not supported. Changing the mode is done by sending a command described in: "USB CDC Subclass Specification for Ethernet Devices v1.2, section 6.2.4". This means that at least in theory this feature should work with all modems that are using this driver. This fixes Huawei E3372h-320 running new firmware in "HiLink" mode. Previously it would reset a few seconds after its mode was changed with "usb_modeswitch". Setting RX filter to default value at the end of attach function fixed that. Sponsored by: Stormshield Obtained from: Semihalf Differential revision: https://reviews.freebsd.org/D31766 MFC after: 2 weeks Reviewed by: hps
* ued may be NULL here which will cause a panic... reproducable byJohn-Mark Gurney2021-06-291-8/+8
| | | | | simply doing a usbconfig reset on a device which doesn't reset itself properly...
* Add support for link status, media and VLAN MTU (if supported) to if_cdce...John-Mark Gurney2021-06-262-5/+150
| | | | | | | | | | | | This makes it more usable in that dhclient will autolaunch from devd now when cdce devices are plugged in.. It also sets the baudrate, but this isn't exported via tools, and CDCE doesn't have a good way to specify the media type, so there isn't a good way to tell userland what the speed is currently... Reviewed by: hps Relnotes: yes Differential Revision: https://reviews.freebsd.org/D30625
* Narrow down the probe range for if_ure(4) compatible devicesHans Petter Selasky2021-06-041-3/+4
| | | | | | | | to only match the first vendor specific interface, if any. PR: 253374 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4).Hans Petter Selasky2021-06-042-275/+890
| | | | | | | Submitted by: fbbz@synack.eu PR: 253374 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Fix for use-after-free by if_ioctl() calls from user-space in USB drivers byHans Petter Selasky2021-05-212-4/+7
| | | | | | | | | detaching the ifnet before the miibus. PR: 252608 Suggested by: jhb@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Remove USB device ID added by SVN r150701 in the CDC USB ethernet driver.Hans Petter Selasky2021-04-221-1/+0
| | | | | | | | Since then, the FreeBSD USB stack has got proper USB RNDIS support. PR: 254345 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* if_smsc: Add the ability to disable "turbo_mode", also called RX frame batching,Hans Petter Selasky2021-04-111-4/+15
| | | | | | | | | similarly to the Linux driver, by a tunable read only sysctl. Submitted by: Oleg Sidorkin <osidorkin@gmail.com> PR: 254884 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Fix for use-after-free in if_ure(4) driver.Hans Petter Selasky2021-01-122-54/+4
| | | | | | | | | | | When detaching the if_ure(4) driver, the TX active USB transfer array may point to freed USB transfers. Given that the number of USB transfers is very low, simply start all transfers every time there is a packet to keep safe from use-after-free. PR: 252608 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Add support for USB-C and TB3 Gen2 to if_ure(4).Hans Petter Selasky2020-12-241-0/+2
| | | | | | | | | Add support for LAN found on Thinkpad USB-C and Thunderbolt Gen 2 docking stations. Submitted by: ali.abdallah@suse.com MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Ensure a minimum packet length before creating a mbuf in if_ure.Hans Petter Selasky2020-12-191-1/+1
| | | | | | | Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368801