aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/net/if_udav.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: Kill left-over cdefs.h includesWarner Losh2025-03-041-1/+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
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Mechanically convert usb ethernet drivers to DrvAPIJustin Hibbits2023-03-061-19/+19
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37812
* usb: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-3/+1
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-061-1/+1
|
* usb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365084
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)Pawel Biernacki2020-02-151-1/+2
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=357972
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-141-13/+13
| | | | | | | Reviewed by: hselasky Notes: svn path=/head/; revision=353509
* Unbreak USB ethernet module buildsJustin Hibbits2019-08-201-0/+6
| | | | | | | Sponsored by: Juniper Networks, Inc. Notes: svn path=/head/; revision=351250
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
* Create a USB_PNP_INFO and use it to export the existing PNPWarner Losh2015-12-111-15/+16
| | | | | | | | | | | | | | tables. Some drivers needed some slight re-arrangement of declarations to accommodate this. Change the USB pnp tables slightly to allow better compatibility with the system by moving linux driver info from start of each entry to the end. All other PNP tables in the system have the per-device flags and such at the end of the elements rather that at the beginning. Differential Review: https://reviews.freebsd.org/D3458 Notes: svn path=/head/; revision=292080
* Make a bunch of USB debug SYSCTLs tunable, so that their value(s) canHans Petter Selasky2015-01-051-1/+1
| | | | | | | be set before the USB device(s) are probed. Notes: svn path=/head/; revision=276701
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-181-5/+5
| | | | Notes: svn path=/head/; revision=271832
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+4
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Bring datasheet URL up to date.Kevin Lo2013-08-161-1/+1
| | | | Notes: svn path=/head/; revision=254404
* - Use the consistenly PHY-specific reset routine PHY_RESET() rather thanKevin Lo2013-06-141-2/+3
| | | | | | | | | | | | generic mii_phy_reset(). - Return the result of mii_mediachg() rather than blindly returning 0. - on smsc(4), driver lock should be held to get current mii_media_active/mii_media_status value. Reviewed by: yongari Notes: svn path=/head/; revision=251734
* Make the USB ethernet methods constant again in if_udav.c,Hans Petter Selasky2012-11-081-5/+13
| | | | | | | | | | so that both adapter variants can be attached at the same time. MFC after: 0 days Notes: svn path=/head/; revision=242777
* The JP1082 device doesn't respond to the MII_BMSR command and it turnsRui Paulo2012-07-151-3/+15
| | | | | | | | out that it has an unusable PHY. It still works, although very slowly, without a PHY, so I implemented non-PHY support in the udav driver. Notes: svn path=/head/; revision=238466
* Fix compiler warnings, mostly signed issues,Hans Petter Selasky2012-04-021-1/+1
| | | | | | | | | when USB modules are compiled with WARNS=9. MFC after: 1 weeks Notes: svn path=/head/; revision=233774
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-4/+1
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+1
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.Pyun YongHyeon2011-10-171-1/+1
| | | | | | | | | | | Because driver is accessing a common MII structure in mii_pollstat(), updating user supplied structure should be done before dropping a driver lock. Reported by: Karim (fodillemlinkarimi <> gmail dot com) Notes: svn path=/head/; revision=226479
* Only the USB root HUB thread is allowed to attach and detach driversHans Petter Selasky2011-07-181-1/+0
| | | | | | | | | | | to and from USB devices. Remove related DEVMETHOD() lines from USB drivers. Reported by: YongHyeon PYUN MFC after: 3 days Notes: svn path=/head/; revision=224180
* - Move all USB device ID arrays into so-called sections,Hans Petter Selasky2011-06-241-1/+1
| | | | | | | | | | | | | | | sorted according to the mode which they support: host, device or dual mode - Add generic tool to extract these data: tools/bus_autoconf Discussed with: imp Suggested by: Robert Millan <rmh@debian.org> PR: misc/157903 MFC after: 14 days Notes: svn path=/head/; revision=223486
* Add new USB ID to UDAV driver.Hans Petter Selasky2011-06-191-0/+1
| | | | | | | | Submitted by: Luiz Gustavo S. Costa <lgcosta@pfsense.org> MFC after: 7 days Notes: svn path=/head/; revision=223288
* - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOPMarius Strobl2011-05-031-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers it was unclear whether the PHYs driven by them actually support loopback or not. Moreover, typically loopback mode also needs to be activated on the MAC, which none of the Ethernet drivers using mii(4) implements. Given that loopback media has no real use (and obviously hardly had a chance to actually work) besides for driver development (which just loopback mode should be sufficient for though, i.e one doesn't necessary need support for loopback media) support for it is just dropped as both NetBSD and OpenBSD already did quite some time ago. - Let mii_phy_add_media() also announce the support of IFM_NONE. - Restructure the PHY entry points to use a structure of entry points instead of discrete function pointers, and extend this to include a "reset" entry point. Make sure any PHY-specific reset routine is always used, and provide one for lxtphy(4) which disables MII interrupts (as is done for a few other PHYs we have drivers for). This includes changing NIC drivers which previously just called the generic mii_phy_reset() to now actually call the PHY-specific reset routine, which might be crucial in some cases. While at it, the redundant checks in these NIC drivers for mii->mii_instance not being zero before calling the reset routines were removed because as soon as one PHY driver attaches mii->mii_instance is incremented and we hardly can end up in their media change callbacks etc if no PHY driver has attached as mii_attach() would have failed in that case and not attach a miibus(4) instance. Consequently, NIC drivers now no longer should call mii_phy_reset() directly, so it was removed from EXPORT_SYMS. - Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe(). The purpose of that function is to perform the common steps to attach a PHY driver instance and to hook it up to the miibus(4) instance and to optionally also handle the probing, addition and initialization of the supported media. So all a PHY driver without any special requirements has to do in its bus attach method is to call mii_phy_dev_attach() along with PHY-specific MIIF_* flags, a pointer to its PHY functions and the add_media set to one. All PHY drivers were updated to take advantage of mii_phy_dev_attach() as appropriate. Along with these changes the capability mask was added to the mii_softc structure so PHY drivers taking advantage of mii_phy_dev_attach() but still handling media on their own do not need to fiddle with the MII attach arguments anyway. - Keep track of the PHY offset in the mii_softc structure. This is done for compatibility with NetBSD/OpenBSD. - Keep track of the PHY's OUI, model and revision in the mii_softc structure. Several PHY drivers require this information also after attaching and previously had to wrap their own softc around mii_softc. NetBSD/OpenBSD also keep track of the model and revision on their mii_softc structure. All PHY drivers were updated to take advantage as appropriate. - Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD. - According to IEEE 802.3-2002 the bits actually have to be reversed when mapping an OUI to the MII ID registers. All PHY drivers and miidevs where changed as necessary. Actually this now again allows to largely share miidevs with NetBSD, which fixed this problem already 9 years ago. Consequently miidevs was synced as far as possible. - Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that weren't explicitly converted to support flow control before. It's unclear whether flow control actually works with these but typically it should and their net behavior should be more correct with these changes in place than without if the MAC driver sets MIIF_DOPAUSE. Obtained from: NetBSD (partially) Reviewed by: yongari (earlier version), silence on arch@ and net@ Notes: svn path=/head/; revision=221407
* Add more udav device ID's.Hans Petter Selasky2011-02-191-0/+4
| | | | | | | | | Submitted by: Rick van der Zwet <info@rickvanderzwet.nl> MFC after: 7 days Approved by: thompsa (mentor) Notes: svn path=/head/; revision=218864
* Remove unneeded includes of <sys/linker_set.h>. Other headers that useJohn Baldwin2011-01-111-1/+0
| | | | | | | | | it internally contain nested includes. Reviewed by: bde Notes: svn path=/head/; revision=217265
* Add missing MODULE_VERSION() definitions, this resolves problems aroundAndrew Thompson2010-09-011-0/+1
| | | | | | | | | | | duplicate module loads. PR: usb/125736 Submitted by: danger, mm Reviewed by: hselasky Notes: svn path=/head/; revision=212122
* Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this hadAndrew Thompson2010-04-221-1/+1
| | | | | | | | | the illusion of a tunable setting but was always turned on regardless. MFC after: 1 week Notes: svn path=/head/; revision=207077
* Remove overuse of exclamation marks in kernel printfs, there mere fact aAndrew Thompson2009-11-261-1/+1
| | | | | | | | | message has been printed is enough to get someones attention. Also remove the line number for DPRINTF/DPRINTFN, it already prints the funtion name and a unique message. Notes: svn path=/head/; revision=199816
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-06-261-2/+2
| | | | | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks Notes: svn path=/head/; revision=195049
* - Make struct usb_xfer opaque so that drivers can not access the internalsAndrew Thompson2009-06-231-40/+57
| | | | | | | - Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h Notes: svn path=/head/; revision=194677
* s/usb2_/usb_|usbd_/ on all function names for the USB stack.Andrew Thompson2009-06-151-39/+39
| | | | Notes: svn path=/head/; revision=194228
* s/usb2_/usb_/ on all typedefs for the USB stack.Andrew Thompson2009-05-291-11/+11
| | | | Notes: svn path=/head/; revision=193045
* s/usb2_/usb_/ on all C structs for the USB stack.Andrew Thompson2009-05-281-24/+24
| | | | Notes: svn path=/head/; revision=192984
* Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.Andrew Thompson2009-05-211-2/+2
| | | | | | | Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=192502
* - rename usb2_mode to usb_mode [1]Andrew Thompson2009-05-211-1/+1
| | | | | | | | | - change variable types to use the enum Submitted by: Hans Petter Selasky [1] Notes: svn path=/head/; revision=192499
* Remove USB shutdown methods from device drivers as its the host controllersAndrew Thompson2009-05-051-16/+0
| | | | | | | | | | responsibility to detach the bus. PR: usb/133896 Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=191825
* MFp4 //depot/projects/usb@159909Andrew Thompson2009-04-051-11/+11
| | | | | | | | | | | | | | | | - make usb2_power_mask_t 16-bit - remove "usb2_config_sub" structure from "usb2_config". To compensate for this "usb2_config" has a new field called "usb_mode" which select for which mode the current xfer entry is active. Options are: a) Device mode only b) Host mode only (default-by-zero) c) Both modes. This change was scripted using the following sed script: "s/\.mh\././g". - the standard packet size table in "usb_transfer.c" is now a function, hence the code for the function uses less memory than the table itself. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=190734
* Rename the ushub device class back to uhub as it was in the old usb stack,Andrew Thompson2009-03-021-1/+1
| | | | | | | | | moused(8) looks for "uhub/ums" to decide if needs to load the module. Reported by: Garrett Cooper Notes: svn path=/head/; revision=189275
* Move the new USB stack into its new home.Andrew Thompson2009-02-231-0/+856
Notes: svn path=/head/; revision=188942