blob: 94a4212a54a6c0351d95f6f062a0b33c60f4f88d [file] [log] [blame]
Eric Wildf5aa5892019-11-27 18:16:17 +01001/*
2 * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Eric Wild <ewild@sysmocom.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef USB_DESCRIPTORS_H_
20#define USB_DESCRIPTORS_H_
21
22#define CCID_NUM_CLK_SUPPORTED 4
23
24/* aggregate descriptors for the combined CDC-ACM + CCID device that we expose
25 * from sysmoQMOD */
26
27enum str_desc_num {
28 STR_DESC_MANUF = 1,
29 STR_DESC_PRODUCT,
30 STR_DESC_CONFIG,
31 STR_DESC_INTF_ACM_COMM,
32 STR_DESC_INTF_ACM_DATA,
33 STR_DESC_INTF_CCID,
34 STR_DESC_SERIAL,
35};
36
37/* a struct of structs representing the concatenated collection of USB descriptors */
38struct usb_desc_collection {
39 struct usb_dev_desc dev;
40 struct usb_config_desc cfg;
41
42 /* CDC-ACM: Two interfaces, one with IRQ EP and one with BULK IN + OUT */
43 struct {
44 struct {
45 struct usb_iface_desc iface;
46 struct usb_cdc_hdr_desc cdc_hdr;
47 struct usb_cdc_call_mgmt_desc cdc_call_mgmt;
48 struct usb_cdc_acm_desc cdc_acm;
49 struct usb_cdc_union_desc cdc_union;
50 struct usb_ep_desc ep[1];
51 } comm;
52 struct {
53 struct usb_iface_desc iface;
54 struct usb_ep_desc ep[2];
55 } data;
56 } cdc;
57
58 /* CCID: One interface with CCID class descriptor and three endpoints */
59 struct {
60 struct usb_iface_desc iface;
61 struct usb_ccid_class_descriptor class;
62 struct usb_ep_desc ep[3];
63 } ccid;
64 uint8_t str[116];
65} __attribute__((packed));
66
67#endif /* USB_DESCRIPTORS_H_ */