VirtualBox

Changeset 53121 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 22, 2014 7:35:21 PM (10 years ago)
Author:
vboxsync
Message:

USB: Added required SS descriptors to emulated MSD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/UsbMsd.cpp

    r53097 r53121  
    342342};
    343343
     344static 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
    344353static const VUSBDESCENDPOINTEX g_aUsbMsdEndpointDescsSS[2] =
    345354{
     
    354363        },
    355364        /* .pvMore = */     NULL,
    356         /* .pvClass = */    NULL,
    357         /* .cbClass = */    0
     365        /* .pvClass = */    &g_aUsbMsdEpCompanionSS,
     366        /* .cbClass = */    sizeof(g_aUsbMsdEpCompanionSS)
    358367    },
    359368    {
     
    367376        },
    368377        /* .pvMore = */     NULL,
    369         /* .pvClass = */    NULL,
    370         /* .cbClass = */    0
     378        /* .pvClass = */    &g_aUsbMsdEpCompanionSS,
     379        /* .cbClass = */    sizeof(g_aUsbMsdEpCompanionSS)
    371380    }
    372381};
     
    548557    /* .bNumConfigurations = */     1,
    549558    /* .bReserved = */              0
     559};
     560
     561static 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    }
    550582};
    551583
     
    18241856                        cbCopy = RT_MIN(cbCopy, sizeof(g_UsbMsdDeviceQualifier));
    18251857                        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);
    18261865                        return usbMsdCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    18271866                    default:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette