github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/usbip.txt (about)

     1  # Copyright 2020 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <drivers/usb/usbip/usbip_common.h>
     5  
     6  resource fd_usbip_server[fd]
     7  
     8  syz_usbip_server_init(speed flags[usbip_device_speed]) fd_usbip_server
     9  write$usbip_server(fd fd_usbip_server, buffer ptr[in, usbip_packet], len bytesize[buffer])
    10  
    11  type usbip_header_basic[PACKET_TYPE] {
    12  	command		const[PACKET_TYPE, int32be]
    13  	seqnum		int32be
    14  	devid		const[0, int32be]
    15  	direction	flags[direction_flags, int32be]
    16  	ep		int32be
    17  } [packed]
    18  
    19  usbip_header_ret_unlink {
    20  	status	int32be
    21  } [packed]
    22  
    23  usbip_iso_packet_descriptor {
    24  	offset		int32be
    25  	length		int32be
    26  	actual_length	int32be
    27  	status		int32be
    28  } [packed]
    29  
    30  usbip_packet_ret_submit {
    31  	base_submit		usbip_header_basic[USBIP_RET_SUBMIT]
    32  	status			int32be
    33  	actual_length		len[xbuff, int32be]
    34  	start_frame		int32be
    35  	number_of_packets	len[iso, int32be]
    36  	error_count		int32be
    37  	padding			const[0, int64be]
    38  	xbuff			array[int8]
    39  	iso			array[usbip_iso_packet_descriptor, 0:USBIP_MAX_ISO_PACKETS]
    40  } [packed]
    41  
    42  define USBIP_HEADER_SIZE	sizeof(struct usbip_header)
    43  
    44  usbip_packet_ret_unlink {
    45  	base_unlink	usbip_header_basic[USBIP_RET_UNLINK]
    46  	ret_unlink	usbip_header_ret_unlink
    47  } [packed, size[USBIP_HEADER_SIZE]]
    48  
    49  usbip_packet [
    50  	ret_submit	usbip_packet_ret_submit
    51  	ret_unlink	usbip_packet_ret_unlink
    52  ] [varlen]
    53  
    54  direction_flags = USBIP_DIR_OUT, USBIP_DIR_IN
    55  usbip_device_speed = USB_SPEED_LOW, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_WIRELESS, USB_SPEED_SUPER