Contiki 2.5
cdc-eth-descriptors.c
1 #include "descriptors.h"
2 #include <cdc-acm/cdc.h>
3 #include <contiki-conf.h>
4 #include <usb-arch.h>
5 
6 const struct usb_st_device_descriptor device_descriptor =
7  {
8  sizeof(struct usb_st_device_descriptor),
9  DEVICE,
10  0x0210,
11  CDC,
12  0,
13  0,
14  CTRL_EP_SIZE,
15  0xffff,
16  0xffff,
17  0x0010,
18  2,
19  1,
20  3,
21  1
22  };
23 
24 const struct configuration_st {
25  struct usb_st_configuration_descriptor configuration;
26  struct usb_st_interface_descriptor comm;
27  struct usb_cdc_header_func_descriptor header;
28  struct usb_cdc_union_func_descriptor union_descr;
29  struct usb_cdc_ethernet_func_descriptor ethernet;
30 #if 1
31  struct usb_st_endpoint_descriptor ep_notification;
32 #endif
33  struct usb_st_interface_descriptor data;
34  struct usb_st_endpoint_descriptor ep_in;
35  struct usb_st_endpoint_descriptor ep_out;
36 } BYTE_ALIGNED configuration_block =
37  {
38  /* Configuration */
39  {
40  sizeof(configuration_block.configuration),
41  CONFIGURATION,
42  sizeof(configuration_block),
43  2,
44  1,
45  0,
46  0x80,
47  50
48  },
49  {
50  sizeof(configuration_block.comm),
51  INTERFACE,
52  0,
53  0,
54  1,
55  CDC,
56  ETHERNET_NETWORKING_CONTROL_MODEL,
57  0,
58  0
59  },
60  {
61  sizeof(configuration_block.header),
62  CS_INTERFACE,
63  CDC_FUNC_DESCR_HEADER,
64  0x0110
65  },
66  {
67  sizeof(configuration_block.union_descr),
68  CS_INTERFACE,
69  CDC_FUNC_DESCR_UNION,
70  0, /* Master */
71  {1} /* Slave */
72  },
73  {
74  sizeof(configuration_block.ethernet),
75  CS_INTERFACE,
76  CDC_FUNC_DESCR_ETHERNET,
77  4,
78  0, /* No statistics */
79  UIP_CONF_BUFFER_SIZE - UIP_CONF_LLH_LEN + 14,
80  0, /* No multicast filters */
81  0 /* No wake-up filters */
82  },
83  {
84  sizeof(configuration_block.ep_notification),
85  ENDPOINT,
86  0x83,
87  0x03,
88  8,
89  100
90  },
91  {
92  sizeof(configuration_block.data),
93  INTERFACE,
94  1,
95  0,
96  2,
97  CDC_DATA,
98  0,
99  TRANSPARENT_PROTOCOL,
100  0
101  },
102  {
103  sizeof(configuration_block.ep_in),
104  ENDPOINT,
105  0x81,
106  0x02,
107  64,
108  0
109  },
110  {
111  sizeof(configuration_block.ep_out),
112  ENDPOINT,
113  0x02,
114  0x02,
115  64,
116  0
117  }
118 
119  };
120 
121 const struct usb_st_configuration_descriptor const *configuration_head =
122 (struct usb_st_configuration_descriptor const*)&configuration_block;