Revision 5fafdf24 hw/usb-msd.c
b/hw/usb-msd.c | ||
---|---|---|
1 |
/*
|
|
1 |
/* |
|
2 | 2 |
* USB Mass Storage Device emulation |
3 | 3 |
* |
4 | 4 |
* Copyright (c) 2006 CodeSourcery. |
... | ... | |
93 | 93 |
0x01, /* u8 bNumInterfaces; (1) */ |
94 | 94 |
0x01, /* u8 bConfigurationValue; */ |
95 | 95 |
0x00, /* u8 iConfiguration; */ |
96 |
0xc0, /* u8 bmAttributes;
|
|
96 |
0xc0, /* u8 bmAttributes; |
|
97 | 97 |
Bit 7: must be set, |
98 | 98 |
6: Self-powered, |
99 | 99 |
5: Remote wakeup, |
100 | 100 |
4..0: resvd */ |
101 | 101 |
0x00, /* u8 MaxPower; */ |
102 |
|
|
102 |
|
|
103 | 103 |
/* one interface */ |
104 | 104 |
0x09, /* u8 if_bLength; */ |
105 | 105 |
0x04, /* u8 if_bDescriptorType; Interface */ |
... | ... | |
110 | 110 |
0x06, /* u8 if_bInterfaceSubClass; SCSI */ |
111 | 111 |
0x50, /* u8 if_bInterfaceProtocol; Bulk Only */ |
112 | 112 |
0x00, /* u8 if_iInterface; */ |
113 |
|
|
113 |
|
|
114 | 114 |
/* Bulk-In endpoint */ |
115 | 115 |
0x07, /* u8 ep_bLength; */ |
116 | 116 |
0x05, /* u8 ep_bDescriptorType; Endpoint */ |
... | ... | |
259 | 259 |
case DeviceRequest | USB_REQ_GET_DESCRIPTOR: |
260 | 260 |
switch(value >> 8) { |
261 | 261 |
case USB_DT_DEVICE: |
262 |
memcpy(data, qemu_msd_dev_descriptor,
|
|
262 |
memcpy(data, qemu_msd_dev_descriptor, |
|
263 | 263 |
sizeof(qemu_msd_dev_descriptor)); |
264 | 264 |
ret = sizeof(qemu_msd_dev_descriptor); |
265 | 265 |
break; |
266 | 266 |
case USB_DT_CONFIG: |
267 |
memcpy(data, qemu_msd_config_descriptor,
|
|
267 |
memcpy(data, qemu_msd_config_descriptor, |
|
268 | 268 |
sizeof(qemu_msd_config_descriptor)); |
269 | 269 |
ret = sizeof(qemu_msd_config_descriptor); |
270 | 270 |
break; |
Also available in: Unified diff