diff options
| author | Nazime Hande Harputluoglu <handeharputlu@google.com> | 2020-10-01 21:53:57 +0000 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2020-10-02 22:00:33 +0200 |
| commit | 5910646c6c6fbb5e48801342677bff9c4609a2ea (patch) | |
| tree | b6f4779d08ce53f9c7e046054ad7c2c78890a652 /sys/linux | |
| parent | 4969d6ca0dd952b9193c3546571a4e19a3b86718 (diff) | |
sys/linux: descriptions for USB/IP
Diffstat (limited to 'sys/linux')
| -rw-r--r-- | sys/linux/usbip.txt | 55 | ||||
| -rw-r--r-- | sys/linux/usbip.txt.const | 14 |
2 files changed, 69 insertions, 0 deletions
diff --git a/sys/linux/usbip.txt b/sys/linux/usbip.txt new file mode 100644 index 000000000..d93d8bc90 --- /dev/null +++ b/sys/linux/usbip.txt @@ -0,0 +1,55 @@ +# Copyright 2020 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include <drivers/usb/usbip/usbip_common.h> + +resource fd_usbip_server[fd] + +syz_usbip_server_init(speed flags[usbip_device_speed]) fd_usbip_server +write$usbip_server(fd fd_usbip_server, buffer ptr[in, usbip_packet], len bytesize[buffer]) + +type usbip_header_basic[PACKET_TYPE] { + command const[PACKET_TYPE, int32be] + seqnum int32be + devid const[0, int32be] + direction flags[direction_flags, int32be] + ep int32be +} [packed] + +usbip_header_ret_unlink { + status int32be +} [packed] + +usbip_iso_packet_descriptor { + offset int32be + length int32be + actual_length int32be + status int32be +} [packed] + +usbip_packet_ret_submit { + base_submit usbip_header_basic[USBIP_RET_SUBMIT] + status int32be + actual_length len[xbuff, int32be] + start_frame int32be + number_of_packets len[iso, int32be] + error_count int32be + padding const[0, int64be] + xbuff array[int8] + iso array[usbip_iso_packet_descriptor, 0:USBIP_MAX_ISO_PACKETS] +} [packed] + +define USBIP_HEADER_SIZE sizeof(struct usbip_header) + +usbip_packet_ret_unlink { + base_unlink usbip_header_basic[USBIP_RET_UNLINK] + ret_unlink usbip_header_ret_unlink +} [packed, size[USBIP_HEADER_SIZE]] + +usbip_packet [ + ret_submit usbip_packet_ret_submit + ret_unlink usbip_packet_ret_unlink +] [varlen] + +direction_flags = USBIP_DIR_OUT, USBIP_DIR_IN +usbip_device_speed = USB_SPEED_LOW, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_WIRELESS, USB_SPEED_SUPER diff --git a/sys/linux/usbip.txt.const b/sys/linux/usbip.txt.const new file mode 100644 index 000000000..6da05ab26 --- /dev/null +++ b/sys/linux/usbip.txt.const @@ -0,0 +1,14 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = 386, amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x +USBIP_DIR_IN = 1 +USBIP_DIR_OUT = 0 +USBIP_HEADER_SIZE = 48 +USBIP_MAX_ISO_PACKETS = 1024 +USBIP_RET_SUBMIT = 3 +USBIP_RET_UNLINK = 4 +USB_SPEED_FULL = 2 +USB_SPEED_HIGH = 3 +USB_SPEED_LOW = 1 +USB_SPEED_SUPER = 5 +USB_SPEED_WIRELESS = 4 +__NR_write = 4, amd64:1, arm64:riscv64:64, mips64le:5001 |
