/* Discover all Nvm Express device namespaces, and create child handles for them with BlockIo and DiskInfo protocol instances. */
EFI_STATUS DiscoverAllNamespaces(IN NVME_CONTROLLER_PRIVATE_DATA *Private)
/* Discover all Nvm Express device namespaces, and create child handles for them with BlockIo and DiskInfo protocol instances. */
EFI_STATUS DiscoverAllNamespaces(IN NVME_CONTROLLER_PRIVATE_DATA *Private)
{
  EFI_STATUS                          Status;
  UINT32                              NamespaceId;
  EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL  *Passthru;
  NamespaceId = 0xFFFFFFFF;
  Passthru    = &Private->Passthru;
  while (TRUE) {
    Status = Passthru->GetNextNamespace (
                         Passthru,
                         (UINT32 *)&NamespaceId
                         );
    if (EFI_ERROR (Status)) {
      break;
    }
    Status = EnumerateNvmeDevNamespace (
               Private,
               NamespaceId
               );
    if (EFI_ERROR (Status)) {
      continue;
    }
  }
  return EFI_SUCCESS;
}