/* * USB/IP request headers * * Each request is transferred across the network to its counterpart, which * facilitates the normal USB communication. The values contained in the headers * are basically the same as in a URB. Currently, four request types are * defined: * * - USBIP_CMD_SUBMIT: a USB request block, corresponds to usb_submit_urb() * (client to server) * * - USBIP_RET_SUBMIT: the result of USBIP_CMD_SUBMIT * (server to client) * * - USBIP_CMD_UNLINK: an unlink request of a pending USBIP_CMD_SUBMIT, * corresponds to usb_unlink_urb() * (client to server) * * - USBIP_RET_UNLINK: the result of USBIP_CMD_UNLINK * (server to client) *
*/ #define USBIP_CMD_SUBMIT 0x0001 #define USBIP_CMD_UNLINK 0x0002 #define USBIP_RET_SUBMIT 0x0003 #define USBIP_RET_UNLINK 0x0004
/* * Arbitrary limit for the maximum number of isochronous packets in an URB, * compare for example the uhci_submit_isochronous function in * drivers/usb/host/uhci-q.c
*/ #define USBIP_MAX_ISO_PACKETS 1024
/** * struct usbip_header_basic - data pertinent to every request * @command: the usbip request type * @seqnum: sequential number that identifies requests; incremented per * connection * @devid: specifies a remote USB device uniquely instead of busnum and devnum; * in the stub driver, this value is ((busnum << 16) | devnum) * @direction: direction of the transfer * @ep: endpoint number
*/ struct usbip_header_basic {
__u32 command;
__u32 seqnum;
__u32 devid;
__u32 direction;
__u32 ep;
} __packed;
/** * struct usbip_header_cmd_submit - USBIP_CMD_SUBMIT packet header * @transfer_flags: URB flags * @transfer_buffer_length: the data size for (in) or (out) transfer * @start_frame: initial frame for isochronous or interrupt transfers * @number_of_packets: number of isochronous packets * @interval: maximum time for the request on the server-side host controller * @setup: setup data for a control request
*/ struct usbip_header_cmd_submit {
__u32 transfer_flags;
__s32 transfer_buffer_length;
/* it is difficult for usbip to sync frames (reserved only?) */
__s32 start_frame;
__s32 number_of_packets;
__s32 interval;
unsignedchar setup[8];
} __packed;
/** * struct usbip_header_ret_submit - USBIP_RET_SUBMIT packet header * @status: return status of a non-iso request * @actual_length: number of bytes transferred * @start_frame: initial frame for isochronous or interrupt transfers * @number_of_packets: number of isochronous packets * @error_count: number of errors for isochronous transfers
*/ struct usbip_header_ret_submit {
__s32 status;
__s32 actual_length;
__s32 start_frame;
__s32 number_of_packets;
__s32 error_count;
} __packed;
/* * This is the same as usb_iso_packet_descriptor but packed for pdu.
*/ struct usbip_iso_packet_descriptor {
__u32 offset;
__u32 length; /* expected length */
__u32 actual_length;
__u32 status;
} __packed;
/* some members of urb must be substituted before. */ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb); void usbip_pad_iso(struct usbip_device *ud, struct urb *urb); int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb);
/* usbip_event.c */ int usbip_init_eh(void); void usbip_finish_eh(void); int usbip_start_eh(struct usbip_device *ud); void usbip_stop_eh(struct usbip_device *ud); void usbip_event_add(struct usbip_device *ud, unsignedlong event); int usbip_event_happened(struct usbip_device *ud); int usbip_in_eh(struct task_struct *task);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.