2 * f_thor.h - USB TIZEN THOR - internal gadget definitions
4 * Copyright (C) 2013 Samsung Electronics
5 * Lukasz Majewski <l.majewski@samsung.com>
7 * SPDX-License-Identifier: GPL-2.0+
13 #include <linux/compiler.h>
14 #include <linux/sizes.h>
16 /* THOR Composite Gadget */
17 #define STRING_MANUFACTURER_IDX 0
18 #define STRING_PRODUCT_IDX 1
19 #define STRING_SERIAL_IDX 2
21 /* ********************************************************** */
22 /* THOR protocol definitions */
23 /* ********************************************************** */
26 * Attribute Vendor descriptor - necessary to prevent ZLP transmission
27 * from Windows XP HOST PC
29 struct usb_cdc_attribute_vendor_descriptor
{
32 __u8 bDescriptorSubType
;
38 #define VER_PROTOCOL_MAJOR 4
39 #define VER_PROTOCOL_MINOR 0
50 RQT_INFO_VER_PROTOCOL
= 1,
54 RQT_INIT_VER_PLATFORM
,
76 struct rqt_box
{ /* total: 256B */
77 s32 rqt
; /* request id */
78 s32 rqt_data
; /* request data id */
79 s32 int_data
[14]; /* int data */
80 char str_data
[5][32]; /* string data */
81 char md5
[32]; /* md5 checksum */
84 struct rsp_box
{ /* total: 128B */
85 s32 rsp
; /* response id (= request id) */
86 s32 rsp_data
; /* response data id */
88 s32 int_data
[5]; /* int data */
89 char str_data
[3][32]; /* string data */
92 struct data_rsp_box
{ /* total: 8B */
93 s32 ack
; /* response id (= request id) */
94 s32 count
; /* response data id */
103 struct usb_gadget
*gadget
;
104 struct usb_request
*req
; /* EP0 -> control responses */
106 /* IN/OUT EP's and correspoinding requests */
107 struct usb_ep
*in_ep
, *out_ep
, *int_ep
;
108 struct usb_request
*in_req
, *out_req
;
110 /* Control flow variables */
111 unsigned char configuration_done
;
112 unsigned char rxdata
;
113 unsigned char txdata
;
117 struct usb_function usb_function
;
118 struct thor_dev
*dev
;
121 #define F_NAME_BUF_SIZE 32
122 #define THOR_PACKET_SIZE SZ_1M /* 1 MiB */
123 #define THOR_STORE_UNIT_SIZE SZ_32M /* 32 MiB */
124 #endif /* _USB_THOR_H_ */