示例#1
0
/**
  Remove the current device configuration.

  @param  Device                The USB device to remove configuration from.

**/
EFI_STATUS
UsbRemoveConfig (
  IN USB_DEVICE           *Device
  )
{
  USB_INTERFACE           *UsbIf;
  UINTN                   Index;
  EFI_STATUS              Status;
  EFI_STATUS              ReturnStatus;

  //
  // Remove each interface of the device
  //
  ReturnStatus = EFI_SUCCESS;
  for (Index = 0; Index < Device->NumOfInterface; Index++) {    
    ASSERT (Index < USB_MAX_INTERFACE);
    UsbIf = Device->Interfaces[Index];

    if (UsbIf == NULL) {
      continue;
    }

    Status = UsbDisconnectDriver (UsbIf);
    if (!EFI_ERROR (Status)) {
      UsbFreeInterface (UsbIf);
      Device->Interfaces[Index] = NULL;
    } else {
      ReturnStatus = Status;
    }
  }

  Device->ActiveConfig    = NULL;
  return ReturnStatus;
}
示例#2
0
/**
  Remove the current device configuration.

  @param  Device                The USB device to remove configuration from.

**/
VOID
UsbRemoveConfig (
  IN USB_DEVICE           *Device
  )
{
  USB_INTERFACE           *UsbIf;
  UINTN                   Index;

  //
  // Remove each interface of the device
  //
  for (Index = 0; Index < Device->NumOfInterface; Index++) {    
    ASSERT (Index < USB_MAX_INTERFACE);
    UsbIf = Device->Interfaces[Index];

    if (UsbIf == NULL) {
      continue;
    }

    UsbDisconnectDriver (UsbIf);
    UsbFreeInterface (UsbIf);
    Device->Interfaces[Index] = NULL;
  }

  Device->ActiveConfig    = NULL;
  Device->NumOfInterface  = 0;
}
示例#3
0
文件: UsbEnumer.c 项目: Kohrara/edk
VOID
UsbRemoveConfig (
  IN USB_DEVICE           *Device
  )
/*++

Routine Description:

  Remove the current device configuration

Arguments:

  Device  - The USB device to remove configuration from

Returns:

  None

--*/
{
  USB_INTERFACE           *UsbIf;
  UINTN                   Index;

  //
  // Remove each interface of the device
  //
  for (Index = 0; Index < Device->NumOfInterface; Index++) {
    UsbIf = Device->Interfaces[Index];

    if (UsbIf == NULL) {
      continue;
    }

    UsbDisconnectDriver (UsbIf);
    UsbFreeInterface (UsbIf);
    Device->Interfaces[Index] = NULL;
  }

  Device->ActiveConfig    = NULL;
  Device->NumOfInterface  = 0;
}