/* Usb hub control transfer to get the (super speed) hub descriptor. */
EFI_STATUS UsbHubCtrlGetHubDesc(IN USB_DEVICE *HubDev, OUT VOID *Buf, IN UINTN Len)
/* Usb hub control transfer to get the (super speed) hub descriptor. */
EFI_STATUS UsbHubCtrlGetHubDesc(IN USB_DEVICE *HubDev, OUT VOID *Buf, IN UINTN Len)
{
  EFI_STATUS  Status;
  UINT8       DescType;
  DescType = (HubDev->Speed == EFI_USB_SPEED_SUPER) ?
             USB_DESC_TYPE_HUB_SUPER_SPEED :
             USB_DESC_TYPE_HUB;
  Status = UsbCtrlRequest (
             HubDev,
             EfiUsbDataIn,
             USB_REQ_TYPE_CLASS,
             USB_HUB_TARGET_HUB,
             USB_HUB_REQ_GET_DESC,
             (UINT16)(DescType << 8),
             0,
             Buf,
             Len
             );
  return Status;
}