Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   maxv
Date:           Sat Sep 14 06:57:52 UTC 2019

Modified Files:
        src/etc: MAKEDEV.tmpl
        src/sys/arch/amd64/conf: GENERIC
        src/sys/conf: files majors
Added Files:
        src/sys/dev/usb: vhci.c

Log Message:
Add vHCI, a driver which allows to send and receive USB packets directly
from userland via /dev/vhci. Using this, it becomes possible to test and
fuzz the USB stack and all the USB drivers without having the associated
hardware.

The vHCI device has four ports independently addressable.

For each xfer on each port, we create two packets: a setup packet (which
indicates mostly the type of request) and a data packet (which contains
the raw data). These packets are processed by read and write operations
on /dev/vhci: userland poll-reads it to fetch usb_device_request_t
structures, and dispatches the requests depending on bRequest and
bmRequestType.

A few ioctls are available:

        VHCI_IOC_GET_INFO   - Get the current status
        VHCI_IOC_SET_PORT   - Choose a vHCI port
        VHCI_IOC_USB_ATTACH - Attach a USB device on the current port
        VHCI_IOC_USB_DETACH - Detach the USB device on the current port

vHCI has already allowed me to automatically find several bugs in the USB
stack and its drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.534 -r1.535 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1238 -r1.1239 src/sys/conf/files
cvs rdiff -u -r1.87 -r1.88 src/sys/conf/majors
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/vhci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index