Revision 6c238527 hw/usb-hub.c
b/hw/usb-hub.c | ||
---|---|---|
138 | 138 |
.str = desc_strings, |
139 | 139 |
}; |
140 | 140 |
|
141 |
static const uint8_t qemu_hub_dev_descriptor[] = { |
|
142 |
0x12, /* u8 bLength; */ |
|
143 |
0x01, /* u8 bDescriptorType; Device */ |
|
144 |
0x10, 0x01, /* u16 bcdUSB; v1.1 */ |
|
145 |
|
|
146 |
0x09, /* u8 bDeviceClass; HUB_CLASSCODE */ |
|
147 |
0x00, /* u8 bDeviceSubClass; */ |
|
148 |
0x00, /* u8 bDeviceProtocol; [ low/full speeds only ] */ |
|
149 |
0x08, /* u8 bMaxPacketSize0; 8 Bytes */ |
|
150 |
|
|
151 |
0x00, 0x00, /* u16 idVendor; */ |
|
152 |
0x00, 0x00, /* u16 idProduct; */ |
|
153 |
0x01, 0x01, /* u16 bcdDevice */ |
|
154 |
|
|
155 |
0x03, /* u8 iManufacturer; */ |
|
156 |
0x02, /* u8 iProduct; */ |
|
157 |
0x01, /* u8 iSerialNumber; */ |
|
158 |
0x01 /* u8 bNumConfigurations; */ |
|
159 |
}; |
|
160 |
|
|
161 |
/* XXX: patch interrupt size */ |
|
162 |
static const uint8_t qemu_hub_config_descriptor[] = { |
|
163 |
|
|
164 |
/* one configuration */ |
|
165 |
0x09, /* u8 bLength; */ |
|
166 |
0x02, /* u8 bDescriptorType; Configuration */ |
|
167 |
0x19, 0x00, /* u16 wTotalLength; */ |
|
168 |
0x01, /* u8 bNumInterfaces; (1) */ |
|
169 |
0x01, /* u8 bConfigurationValue; */ |
|
170 |
0x00, /* u8 iConfiguration; */ |
|
171 |
0xe0, /* u8 bmAttributes; |
|
172 |
Bit 7: must be set, |
|
173 |
6: Self-powered, |
|
174 |
5: Remote wakeup, |
|
175 |
4..0: resvd */ |
|
176 |
0x00, /* u8 MaxPower; */ |
|
177 |
|
|
178 |
/* USB 1.1: |
|
179 |
* USB 2.0, single TT organization (mandatory): |
|
180 |
* one interface, protocol 0 |
|
181 |
* |
|
182 |
* USB 2.0, multiple TT organization (optional): |
|
183 |
* two interfaces, protocols 1 (like single TT) |
|
184 |
* and 2 (multiple TT mode) ... config is |
|
185 |
* sometimes settable |
|
186 |
* NOT IMPLEMENTED |
|
187 |
*/ |
|
188 |
|
|
189 |
/* one interface */ |
|
190 |
0x09, /* u8 if_bLength; */ |
|
191 |
0x04, /* u8 if_bDescriptorType; Interface */ |
|
192 |
0x00, /* u8 if_bInterfaceNumber; */ |
|
193 |
0x00, /* u8 if_bAlternateSetting; */ |
|
194 |
0x01, /* u8 if_bNumEndpoints; */ |
|
195 |
0x09, /* u8 if_bInterfaceClass; HUB_CLASSCODE */ |
|
196 |
0x00, /* u8 if_bInterfaceSubClass; */ |
|
197 |
0x00, /* u8 if_bInterfaceProtocol; [usb1.1 or single tt] */ |
|
198 |
0x00, /* u8 if_iInterface; */ |
|
199 |
|
|
200 |
/* one endpoint (status change endpoint) */ |
|
201 |
0x07, /* u8 ep_bLength; */ |
|
202 |
0x05, /* u8 ep_bDescriptorType; Endpoint */ |
|
203 |
0x81, /* u8 ep_bEndpointAddress; IN Endpoint 1 */ |
|
204 |
0x03, /* u8 ep_bmAttributes; Interrupt */ |
|
205 |
0x02, 0x00, /* u16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) */ |
|
206 |
0xff /* u8 ep_bInterval; (255ms -- usb 2.0 spec) */ |
|
207 |
}; |
|
208 |
|
|
209 | 141 |
static const uint8_t qemu_hub_hub_descriptor[] = |
210 | 142 |
{ |
211 | 143 |
0x00, /* u8 bLength; patched in later */ |
Also available in: Unified diff