aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_ioctl.h
Commit message (Collapse)AuthorAgeFilesLines
* usb: remove COMPAT_32BIT ifdefsBrooks Davis2021-12-171-49/+18
| | | | | | | | | | | Now that we have proper 32-bit compat support, remove COMPAT_32BIT ifdefs to allow 32-bit code to use the 64-bit layout of USB ioctl structs and struct usb_fs_endpoint. This includes the removal of redundant alignment directives that had no effect in practice. Reviewed by: hselasky, jrtc27 (prior version)
* usb: add 32-bit compat for FIFOsBrooks Davis2021-12-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Unlike most 32-bit compatability code, this isn't just a simple thunk in the ioctl code. An ioctl (USB_FS_INIT) is used to install a pointer to an array of usb_fs_endpoint structs which are then used by the ugen fifo code. These struct contains an array of pointers which requires translation. We change the interfaces around struct usb_fs_endpoint as follows: - We store the size of struct usb_fs_endpoint in struct usb_fifo in the USB_FS_INIT handler so we know the ABI of the userspace array. - APIs to manipulate userspace struct usb_fs_endpoint objects now take a struct usb_fifo and an index rather than a pointer to the object. This allows most code to remain oblivious to the different struct usb_fs_endpoint sizes. - Add ugen_fs_copyin() which copies the struct usb_fs_endpoint from userspace, thunking it to the native size if required. - Uses of struct usb_fs_endpoint's ppBuffer member are now via ugen_fs_getbuffer() which produces a native pointer. - Updates to userspace are now handled by ugen_fs_update(). For clarity, single, fixed-sized members now are accessed with fueword/suword rather than copyin/copyout. Reviewed by: hselasky, jrtc27 (prior version)
* usb: real freebsd32 support for most ioctlsBrooks Davis2021-12-171-0/+57
| | | | | | | | | | | | Use thunks or alternative access methods to support ioctls without the COMPAT_32BIT hacks that store pointers in uint64_t's on 32-bit platforms. This should allow a normal i386 libusb to work. On CheriBSD, the sizes of the structs will differ between CheriABI (the default) and freebsd64 no matter what so we need proper compat support there. This change paves the way. Reviewed by: hselasky, jrtc27 (prior version)
* hid: Import hidraw(4) - driver for access to raw HID device dataVladimir Kondratyev2021-01-071-1/+1
| | | | | | | | | | | | This driver provides raw access to HID devices through uhid(4)-compatible interface and is based on pre-8.x uhid(4) code. Unlike uhid(4) it does not take devices in to monopoly ownership and allows parallel access from other drivers. hidraw supports Linux's hidraw-compatible interface as well. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27992
* Increase the maximum user-space buffer size from 256kBytes to 32MBytes forHans Petter Selasky2019-09-201-1/+1
| | | | | | | | | | | | libusb. This is useful for speeding up large data transfers while reducing the interrupt rate. Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352555
* Add cdceem(4) driver, for virtual ethernet devices compliantEdward Tomasz Napierala2019-08-071-0/+1
| | | | | | | | | | | | | | | | | 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
* Add a "multifunction" device side USB template, which provides massEdward Tomasz Napierala2018-05-171-0/+1
| | | | | | | | | | | | | 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
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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
* Add USB MIDI template for USB device side mode.Hans Petter Selasky2015-06-011-0/+1
| | | | Notes: svn path=/head/; revision=283879
* Add usb template SERIALNET allowing us to have both USB CDC EthernetRuslan Bukin2015-01-131-0/+1
| | | | | | | | | 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-051-0/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=269567
* - Try to fix build of 32-bit compatibility USB support for FreeBSD andHans Petter Selasky2013-08-121-21/+32
| | | | | | | | | | | | | | Linux targets without breaking the existing IOCTL API. - Remove some not-needed header file inclusions. - Wrap a long line. MFC after: 1 week Reported by: Damjan Jovanovic <damjan.jov@gmail.com> Notes: svn path=/head/; revision=254243
* Add new USB API to get the port path of a USB device.Hans Petter Selasky2013-05-031-1/+11
| | | | | | | | MFC after: 2 weeks Requested by: emaste @ Notes: svn path=/head/; revision=250201
* Add USB API to read power draw on USB devices.Hans Petter Selasky2013-02-141-1/+2
| | | | | | | | | | Update usbconfig to print power draw on USB devices. MFC after: 2 weeks Submitted by: Matt Burke @ icritical.com Notes: svn path=/head/; revision=246789
* Modify the FreeBSD USB kernel code so that it can be compiled directlyHans Petter Selasky2013-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename new IOCTL to singular form of the noun "streams".Hans Petter Selasky2012-08-131-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=239238
* Add support for the so-called streams feature of BULK endpointsHans Petter Selasky2012-08-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in SUPER-speed mode, USB 3.0. This feature has not been tested yet, due to lack of hardware. This feature is useful when implementing protocols like UASP, USB attached SCSI which promises higher USB mass storage throughput. This patch also implements support for hardware processing of endpoints for increased performance. The switching to hardware processing of an endpoint is done via a callback to the USB controller driver. The stream feature is implemented like a variant of a hardware USB protocol. USB controller drivers implementing device mode needs to be updated to implement the new "xfer_stall" USB controller method and remove the "xfer" argument from the "set_stall" method. The API's toward existing USB drivers are preserved. To setup a USB transfer in stream mode, set the "stream_id" field of the USB config structure to the desired value. The maximum number of BULK streams is currently hardcoded and limited to 8 via a define in usb_freebsd.h. All USB drivers should be re-compiled after this change. LibUSB will be updated next week to support streams mode. A new IOCTL to setup BULK streams as already been implemented. The ugen device nodes currently only supports stream ID zero. The FreeBSD version has been bumped. MFC after: 2 weeks Notes: svn path=/head/; revision=239214
* - This patch adds custom IOCTLs to read and write the 4 GPIO pins on theHans Petter Selasky2011-11-121-0/+4
| | | | | | | | | | | | cp2103 usb-to-serial chip. - This patch also makes the line status polling asynchronous, to reduce the time needed to change the GPIO pins. Submitted by: JD Louw MFC after: 1 week Notes: svn path=/head/; revision=227463
* - Add more USB templates for various USB device classesHans Petter Selasky2011-06-231-0/+14
| | | | | | | | | | - 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
* - Add support for software pre-scaling of ISOCHRONOUS transfers.Hans Petter Selasky2011-02-281-2/+3
| | | | | | | | MFC after: 14 days Approved by: thompsa (mentor) Notes: svn path=/head/; revision=219100
* - Add support for LibUSB in 32-bit compatibility mode.Hans Petter Selasky2010-10-141-0/+21
| | | | | | | Approved by: thompsa (mentor) Notes: svn path=/head/; revision=213852
* - Make struct usb_xfer opaque so that drivers can not access the internalsAndrew Thompson2009-06-231-4/+1
| | | | | | | - 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
* Fix _USB2_* refernces in the header protection defines.Andrew Thompson2009-06-151-3/+3
| | | | Notes: svn path=/head/; revision=194230
* s/usb2_/usb_/ on all C structs for the USB stack.Andrew Thompson2009-05-281-50/+50
| | | | Notes: svn path=/head/; revision=192984
* Change USB over to make_dev() for all device nodes, previously it hooked intoAndrew Thompson2009-02-271-21/+3
| | | | | | | | | | | | | | | | | | the devfs clone handler to open the (invisible) devices on the fly. The /dev entries are layed out as follows, /dev/usbctl = master device /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>) /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint This also removes the custom permissions model from USB. Bump __FreeBSD_version to 800066. Submitted by: rink (earlier version) Notes: svn path=/head/; revision=189110
* MFp4 //depot/projects/usb@157974Andrew Thompson2009-02-241-0/+2
| | | | | | | | | | Add support for setting and getting the USB template value through libusb20 and usbconfig. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=188987
* MFp4 //depot/projects/usb@157853Andrew Thompson2009-02-241-1/+0
| | | | | | | | | | Clean up old way of polling the USB hardware. The existing polling support was a bit hackish. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=188983
* Move the new USB stack into its new home.Andrew Thompson2009-02-231-0/+292
Notes: svn path=/head/; revision=188942