/* The GetModeData() function is used to read the current mode data (operational parameters) from the MNP or the underlying SNP. */
EFI_STATUS EFIAPI MnpGetModeData(IN EFI_MANAGED_NETWORK_PROTOCOL *This, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
/* The GetModeData() function is used to read the current mode data (operational parameters) from the MNP or the underlying SNP. */
EFI_STATUS EFIAPI MnpGetModeData(IN EFI_MANAGED_NETWORK_PROTOCOL *This, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
{
  MNP_INSTANCE_DATA            *Instance;
  EFI_SIMPLE_NETWORK_PROTOCOL  *Snp;
  EFI_TPL                      OldTpl;
  EFI_STATUS                   Status;
  UINT32                       InterruptStatus;
  if (This == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
  if (MnpConfigData != NULL) {
    CopyMem (MnpConfigData, &Instance->ConfigData, sizeof (*MnpConfigData));
  }
  if (SnpModeData != NULL) {
    Snp = Instance->MnpServiceData->MnpDeviceData->Snp;
    Snp->GetStatus (Snp, &InterruptStatus, NULL);
    CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
  }
  if (!Instance->Configured) {
    Status = EFI_NOT_STARTED;
  } else {
    Status = EFI_SUCCESS;
  }
  gBS->RestoreTPL (OldTpl);
  return Status;
}