aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/template
Commit message (Collapse)AuthorAgeFilesLines
* usb: Kill left-over cdefs.h includesWarner Losh2025-03-042-2/+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-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1612-12/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1214-14/+14
| | | | | | | | | 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
* usb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-014-16/+0
| | | | Notes: svn path=/head/; revision=365084
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)Pawel Biernacki2020-02-1513-13/+13
| | | | | | | | | | | | | | | 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
* Add cdceem(4) driver, for virtual ethernet devices compliantEdward Tomasz Napierala2019-08-073-1/+267
| | | | | | | | | | | | | | | | | with Communication Device Class Ethernet Emulation Model (CDC EEM). The driver supports both the device, and host side operation; there is a new USB template (#11) for the former. This enables communication with virtual USB NIC provided by iLO 5, as found in new HPE Proliant servers. Reviewed by: hselasky MFC after: 2 weeks Relnotes: yes Sponsored by: Hewlett Packard Enterprise Notes: svn path=/head/; revision=350685
* Set bDeviceClass properly for composite device (template 8). There shouldEdward Tomasz Napierala2018-06-011-1/+1
| | | | | | | | | | | | be no functional change. PR: 203289 Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=334476
* Clarify that USB bus power consumption is measured in mA at 5V.Edward Tomasz Napierala2018-05-241-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=334173
* Centralize USB device mode bus power reporting, and addEdward Tomasz Napierala2018-05-2312-30/+59
| | | | | | | | | | | hw.usb.template_power sysctl to control it. Reviewed by: hselasky@ (earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=334115
* Add new PIDs for Audio, CDCE, MTP, and Mass Storage, fromEdward Tomasz Napierala2018-05-224-4/+4
| | | | | | | | | | | | https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt. Big thanks to Christian Starkjohann for allocating those. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=334061
* Add a somewhat ugly hack that makes OSX serial device node namesEdward Tomasz Napierala2018-05-213-3/+21
| | | | | | | | | | human-readable. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333989
* Improve description strings for USB device-mode serial ports.Edward Tomasz Napierala2018-05-213-6/+6
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333987
* Use USB Vendor Identifiers and Product Identifiers provided by V-USBEdward Tomasz Napierala2018-05-2112-23/+28
| | | | | | | | | | | | (https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt). Previously we were using an invalid (not assigned to us) VID. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333982
* Fix whitespace; no functional changes.Edward Tomasz Napierala2018-05-193-5/+5
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333878
* Add #defines for vendor/product USB IDs. No functional changes.Edward Tomasz Napierala2018-05-1911-22/+44
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333877
* Stop claiming the device-side USB serial interfaces talk Hayes AT.Edward Tomasz Napierala2018-05-183-3/+3
| | | | | | | | | | | There should be no functional difference. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333814
* Add a "multifunction" device side USB template, which provides massEdward Tomasz Napierala2018-05-173-0/+513
| | | | | | | | | | | | | storage, CDC ACM (serial), and CDC ECM (ethernet) at the same time. It's quite similar in function to Linux' "g_multi" gadget. Reviewed by: hselasky@ MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333760
* Fix off-by-one in usb_decode_str_desc(). Previously it would decodeEdward Tomasz Napierala2018-05-171-1/+6
| | | | | | | | | | | | one character too many. Note that this function is only used to decode string descriptors generated by the kernel itself. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333718
* Fix sysctl description.Edward Tomasz Napierala2018-05-151-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333632
* Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collisionHans Petter Selasky2018-02-0710-10/+10
| | | | | | | | | | when building stand/usb. Regression after r328194. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=328985
* Add missing manufacturer/serial number string descriptors.Edward Tomasz Napierala2018-01-216-20/+142
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328219
* Remove unused index.Edward Tomasz Napierala2018-01-201-1/+0
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328197
* Add missing SPDX tags; the rest of the license text is the same as in otherEdward Tomasz Napierala2018-01-203-0/+6
| | | | | | | | | | USB templates. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328196
* Add sysctls to control device side USB identifiers. This makes itEdward Tomasz Napierala2018-01-2012-395/+1025
| | | | | | | | | | | | | | possible to change string and numeric vendor and product identifiers, as well as anything else there might be to change for a particular device side template, eg the MAC address. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13920 Notes: svn path=/head/; revision=328194
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-279-0/+18
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. 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. Notes: svn path=/head/; revision=326255
* Replace some magic numbers in usb_template(4) code with #defines.Edward Tomasz Napierala2017-10-157-44/+44
| | | | | | | | | | | | There should be no functional changes. Reviewed by: hselasky MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12670 Notes: svn path=/head/; revision=324626
* Resolve deadlock between device_detach() and usbd_do_request_flags()Hans Petter Selasky2016-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ MFC after: 1 week Notes: svn path=/head/; revision=305421
* Fix MTP description in the comment.Edward Tomasz Napierala2016-07-291-1/+1
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=303476
* dev/usb: minor spelling fixes in comments.Pedro F. Giffuni2016-05-021-2/+2
| | | | | | | | | No functional change. Reviewed by: hselasky Notes: svn path=/head/; revision=298932
* Fix spelling.Hans Petter Selasky2015-06-031-1/+1
| | | | Notes: svn path=/head/; revision=283952
* Add USB MIDI template for USB device side mode.Hans Petter Selasky2015-06-013-0/+244
| | | | Notes: svn path=/head/; revision=283879
* Add usb template SERIALNET allowing us to have both USB CDC EthernetRuslan Bukin2015-01-133-0/+391
| | | | | | | | | and USB CDC Modem same time by single cable. Reviewed by: hselasky@ Notes: svn path=/head/; revision=277129
* Add new USB phone descriptor template for USB device side mode.Hans Petter Selasky2014-08-053-3/+426
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=269567
* USB method structures for USB controllers and USB pipes should beHans Petter Selasky2013-12-111-1/+1
| | | | | | | | constant and does not need to be modified. This also saves a small amount of RAM. Notes: svn path=/head/; revision=259218
* - Add more defines to limit USB memory usage and number of allocationsHans Petter Selasky2013-05-031-7/+4
| | | | | | | | | | | in reduced memory systems. - Split allocation and freeing of the configuration descriptor into a separate function, so that the configuration descriptor can be made fixed size to save memory allocations. This applies for both device and host mode. Notes: svn path=/head/; revision=250207
* - Move scratch data from the USB bus structure to the USB device structureHans Petter Selasky2013-02-101-26/+39
| | | | | | | | | | | | | so that simultaneous access cannot happen. Protect scratch area using the enumeration lock. Also reduce stack usage in usbd_transfer_setup() by moving some big stack members to the scratch area. This saves around 200 bytes of stack. - Fix a whitespace. MFC after: 1 week Notes: svn path=/head/; revision=246616
* Use string literals in string descriptors for marginallyHans Petter Selasky2013-01-307-101/+30
| | | | | | | | | better readability. Submitted by: Christoph Mallon Notes: svn path=/head/; revision=246125
* Provide one global language string descriptor forHans Petter Selasky2013-01-307-42/+22
| | | | | | | | | | american english instead of giving each module its own. Submitted by: Christoph Mallon Notes: svn path=/head/; revision=246123
* Modify the FreeBSD USB kernel code so that it can be compiled directlyHans Petter Selasky2013-01-308-21/+39
| | | | | | | | | | | | | | | | | | | | | | | | | into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems or embedded platforms. This is also useful for out of the system compilation of the FreeBSD USB stack for various purposes. The USB kernel files can now optionally include a global header file which should include all needed definitions required to compile the FreeBSD USB stack. When the global USB header file is included, no other USB header files will be included by default. Add new file containing the USB stack configuration for the FreeBSD loader build. Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all USB files follow the same style. Use cases: - console in loader via USB - loading kernel via USB Discussed with: Hiroki Sato, hrs @ EuroBSDCon Notes: svn path=/head/; revision=246122
* Remove some extra and not needed space characters.Hans Petter Selasky2013-01-283-3/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=246027
* 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
* Correct some bInterval USB template descriptor values.Hans Petter Selasky2011-12-064-10/+10
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=228304
* Style change.Hans Petter Selasky2011-11-121-2/+2
| | | | | | | | | | | | | | | - Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. MFC after: 1 week Notes: svn path=/head/; revision=227461
* - Add some comments about the origin of some USB descriptors.Hans Petter Selasky2011-06-233-1/+10
| | | | | | | MFC after: 7 days Notes: svn path=/head/; revision=223472
* - Add more USB templates for various USB device classesHans Petter Selasky2011-06-239-11/+1155
| | | | | | | | | | - Add basic template support for USB 3.0 - Export definition of template sysctl numbers through usb_ioctl.h MFC after: 7 days Notes: svn path=/head/; revision=223467
* Minor cleanup:Hans Petter Selasky2011-02-091-1/+1
| | | | | | | | | | | - use device_printf() instead of printf() to give more accurate warnings. - use memcpy() instead of bcopy(). - add missing #if's for non-FreeBSD compilation. Approved by: thompsa (mentor) Notes: svn path=/head/; revision=218475
* Remove unneeded includes of <sys/linker_set.h>. Other headers that useJohn Baldwin2011-01-114-4/+0
| | | | | | | | | it internally contain nested includes. Reviewed by: bde Notes: svn path=/head/; revision=217265
* isochronous endpoint descriptors should have two more bytes which are zero byAndrew Thompson2010-03-111-7/+16
| | | | | | | | | default. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=205033
* - make the usb_temp_setup() and usb_temp_unsetup() functions public so thatAndrew Thompson2010-03-113-21/+17
| | | | | | | | | | | | other modules can generate USB descriptors. - extend the vendor specific request function by one length pointer argument, because not all descriptors store the length in the first byte. For example HID descriptors. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=205030