/* Read the whole usb hub descriptor. It is necessary to do it in two steps because hub descriptor is of variable length. */
EFI_STATUS PeiUsbHubReadDesc(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice, IN PEI_USB_IO_PPI *UsbIoPpi, OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor)
/* Read the whole usb hub descriptor. It is necessary to do it in two steps because hub descriptor is of variable length. */
EFI_STATUS PeiUsbHubReadDesc(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice, IN PEI_USB_IO_PPI *UsbIoPpi, OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor)
{
  EFI_STATUS  Status;
  Status = PeiGetHubDescriptor (PeiServices, PeiUsbDevice, UsbIoPpi, 2, HubDescriptor);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  return PeiGetHubDescriptor (PeiServices, PeiUsbDevice, UsbIoPpi, HubDescriptor->Length, HubDescriptor);
}