/* Check whether a usb device path is in a DEVICE_PATH_LIST_ITEM list. */
BOOLEAN EFIAPI SearchUsbDPInList(IN EFI_DEVICE_PATH_PROTOCOL *UsbDP, IN LIST_ENTRY *UsbIoDPList)
/* Check whether a usb device path is in a DEVICE_PATH_LIST_ITEM list. */
BOOLEAN EFIAPI SearchUsbDPInList(IN EFI_DEVICE_PATH_PROTOCOL *UsbDP, IN LIST_ENTRY *UsbIoDPList)
{
  LIST_ENTRY             *ListIndex;
  DEVICE_PATH_LIST_ITEM  *ListItem;
  BOOLEAN                Found;
  UINTN                  UsbDpDevicePathSize;
  if ((UsbIoDPList == NULL) || (UsbDP == NULL)) {
    return FALSE;
  }
  Found     = FALSE;
  ListIndex = UsbIoDPList->ForwardLink;
  while (ListIndex != UsbIoDPList) {
    ListItem = CR (ListIndex, DEVICE_PATH_LIST_ITEM, Link, DEVICE_PATH_LIST_ITEM_SIGNATURE);
    ASSERT (ListItem->DevicePath != NULL);
    UsbDpDevicePathSize = GetDevicePathSize (UsbDP);
    if (UsbDpDevicePathSize == GetDevicePathSize (ListItem->DevicePath)) {
      if ((CompareMem (UsbDP, ListItem->DevicePath, UsbDpDevicePathSize)) == 0) {
        Found = TRUE;
        break;
      }
    }
    ListIndex =  ListIndex->ForwardLink;
  }
  return Found;
}