Changeset 53121 in vbox
- Timestamp:
- Oct 22, 2014 7:35:21 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vusb.h
r53098 r53121 70 70 #define VUSB_DT_INTERFACE_MIN_LEN 9 71 71 #define VUSB_DT_ENDPOINT_MIN_LEN 7 72 /** @} */ 73 74 /** @name USB Device Capability Type Codes (from spec) 75 * @{ */ 76 #define VUSB_DCT_WIRELESS_USB 0x01 77 #define VUSB_DCT_USB_20_EXTENSION 0x02 78 #define VUSB_DCT_SUPERSPEED_USB 0x03 79 #define VUSB_DCT_CONTAINER_ID 0x04 72 80 /** @} */ 73 81 … … 203 211 uint8_t iInterface; 204 212 } VUSBDESCINTERFACE; 205 /** Pointer to a nUSB interface descriptor. */213 /** Pointer to a USB interface descriptor. */ 206 214 typedef VUSBDESCINTERFACE *PVUSBDESCINTERFACE; 207 215 /** Pointer to a const USB interface descriptor. */ … … 221 229 uint8_t bInterval; 222 230 } VUSBDESCENDPOINT; 223 /** Pointer to a nUSB endpoint descriptor. */231 /** Pointer to a USB endpoint descriptor. */ 224 232 typedef VUSBDESCENDPOINT *PVUSBDESCENDPOINT; 225 233 /** Pointer to a const USB endpoint descriptor. */ … … 238 246 uint16_t wBytesPerInterval; 239 247 } VUSBDESCSSEPCOMPANION; 240 /** Pointer to a nUSB endpoint companion descriptor. */248 /** Pointer to a USB endpoint companion descriptor. */ 241 249 typedef VUSBDESCSSEPCOMPANION *PVUSBDESCSSEPCOMPANION; 242 250 /** Pointer to a const USB endpoint companion descriptor. */ … … 254 262 uint8_t bNumDeviceCaps; 255 263 } VUSBDESCBOS; 256 /** Pointer to a nUSB BOS descriptor. */264 /** Pointer to a USB BOS descriptor. */ 257 265 typedef VUSBDESCBOS *PVUSBDESCBOS; 258 266 /** Pointer to a const USB BOS descriptor. */ … … 261 269 262 270 /** 263 * USB Device Capabilty Descriptor within BOS (from USB3 spec)271 * Generic USB Device Capability Descriptor within BOS (from USB3 spec) 264 272 */ 265 273 typedef struct VUSBDESCDEVICECAP … … 270 278 uint8_t aCapSpecific[1]; 271 279 } VUSBDESCDEVICECAP; 272 /** Pointer to a nUSB device capability descriptor. */280 /** Pointer to a USB device capability descriptor. */ 273 281 typedef VUSBDESCDEVICECAP *PVUSBDESCDEVICECAP; 274 282 /** Pointer to a const USB device capability descriptor. */ 275 283 typedef const VUSBDESCDEVICECAP *PCVUSBDESCDEVICECAP; 284 285 286 /** 287 * SuperSpeed USB Device Capability Descriptor within BOS 288 */ 289 typedef struct VUSBDESCSSDEVCAP 290 { 291 uint8_t bLength; 292 uint8_t bDescriptorType; /* DEVICE CAPABILITY */ 293 uint8_t bDevCapabilityType; /* SUPERSPEED_USB */ 294 uint8_t bmAttributes; 295 uint16_t wSpeedsSupported; 296 uint8_t bFunctionalitySupport; 297 uint8_t bU1DevExitLat; 298 uint16_t wU2DevExitLat; 299 } VUSBDESCSSDEVCAP; 300 /** Pointer to an SS USB device capability descriptor. */ 301 typedef VUSBDESCSSDEVCAP *PVUSBDESCSSDEVCAP; 302 /** Pointer to a const SS USB device capability descriptor. */ 303 typedef const VUSBDESCSSDEVCAP *PCVUSBDESCSSDEVCAP; 304 305 306 /** 307 * USB 2.0 Extension Descriptor within BOS 308 */ 309 typedef struct VUSBDESCUSB2EXT 310 { 311 uint8_t bLength; 312 uint8_t bDescriptorType; /* DEVICE CAPABILITY */ 313 uint8_t bDevCapabilityType; /* USB 2.0 EXTENSION */ 314 uint8_t bmAttributes; 315 } VUSBDESCUSB2EXT; 316 /** Pointer to a USB 2.0 extension capability descriptor. */ 317 typedef VUSBDESCUSB2EXT *PVUSBDESCUSB2EXT; 318 /** Pointer to a const USB 2.0 extension capability descriptor. */ 319 typedef const VUSBDESCUSB2EXT *PCVUSBDESCUSB2EXT; 276 320 277 321 -
trunk/src/VBox/Devices/Storage/UsbMsd.cpp
r53097 r53121 342 342 }; 343 343 344 static const VUSBDESCSSEPCOMPANION g_aUsbMsdEpCompanionSS = 345 { 346 /* .bLength = */ sizeof(VUSBDESCSSEPCOMPANION), 347 /* .bDescriptorType = */ VUSB_DT_SS_ENDPOINT_COMPANION, 348 /* .bMaxBurst = */ 15 /* we can burst all the way */, 349 /* .bmAttributes = */ 0 /* no streams */, 350 /* .wBytesPerInterval = */ 0 /* not a periodic endpoint */ 351 }; 352 344 353 static const VUSBDESCENDPOINTEX g_aUsbMsdEndpointDescsSS[2] = 345 354 { … … 354 363 }, 355 364 /* .pvMore = */ NULL, 356 /* .pvClass = */ NULL,357 /* .cbClass = */ 0365 /* .pvClass = */ &g_aUsbMsdEpCompanionSS, 366 /* .cbClass = */ sizeof(g_aUsbMsdEpCompanionSS) 358 367 }, 359 368 { … … 367 376 }, 368 377 /* .pvMore = */ NULL, 369 /* .pvClass = */ NULL,370 /* .cbClass = */ 0378 /* .pvClass = */ &g_aUsbMsdEpCompanionSS, 379 /* .cbClass = */ sizeof(g_aUsbMsdEpCompanionSS) 371 380 } 372 381 }; … … 548 557 /* .bNumConfigurations = */ 1, 549 558 /* .bReserved = */ 0 559 }; 560 561 static const struct { 562 VUSBDESCBOS bos; 563 VUSBDESCSSDEVCAP sscap; 564 } g_UsbMsdBOS = 565 { 566 { 567 /* .bLength = */ sizeof(g_UsbMsdBOS.bos), 568 /* .bDescriptorType = */ VUSB_DT_BOS, 569 /* .wTotalLength = */ sizeof(g_UsbMsdBOS), 570 /* .bNumDeviceCaps = */ 1 571 }, 572 { 573 /* .bLength = */ sizeof(VUSBDESCSSDEVCAP), 574 /* .bDescriptorType = */ VUSB_DT_DEVICE_CAPABILITY, 575 /* .bDevCapabilityType = */ VUSB_DCT_SUPERSPEED_USB, 576 /* .bmAttributes = */ 0 /* No LTM. */, 577 /* .wSpeedsSupported = */ 0xe /* Any speed is good. */, 578 /* .bFunctionalitySupport = */ 2 /* Want HS at least. */, 579 /* .bU1DevExitLat = */ 0, /* We are blazingly fast. */ 580 /* .wU2DevExitLat = */ 0 581 } 550 582 }; 551 583 … … 1824 1856 cbCopy = RT_MIN(cbCopy, sizeof(g_UsbMsdDeviceQualifier)); 1825 1857 memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbMsdDeviceQualifier, cbCopy); 1858 return usbMsdCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); 1859 case VUSB_DT_BOS: 1860 Log(("usbMsd: GET_DESCRIPTOR DT_BOS wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex)); 1861 /* Returned data is written after the setup message. */ 1862 cbCopy = pUrb->cbData - sizeof(*pSetup); 1863 cbCopy = RT_MIN(cbCopy, sizeof(g_UsbMsdBOS)); 1864 memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbMsdBOS, cbCopy); 1826 1865 return usbMsdCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); 1827 1866 default:
Note:
See TracChangeset
for help on using the changeset viewer.