/** 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; }
/** 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; }
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; }