Make UEFI boot-platform build again
[haiku.git] / headers / private / shared / usb-utils.h
blob4ce85ea25950cfbcd153c3f84b08038a9b60b1d1
1 /*
2 * Copyright 2008-2012, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Jérôme Duval
7 */
10 #include <stdio.h>
12 #include "usbhdr.h"
15 void
16 usb_get_vendor_info(uint16 vendorID, const char **vendorName)
18 int i;
19 for (i = 0; i < (int)USB_VENTABLE_LEN; i++) {
20 if (UsbVenTable[i].VenId == vendorID) {
21 *vendorName = UsbVenTable[i].VenName && UsbVenTable[i].VenName[0]
22 ? UsbVenTable[i].VenName : NULL;
23 return;
26 *vendorName = NULL;
30 void
31 usb_get_device_info(uint16 vendorID, uint16 deviceID, const char **deviceName)
33 int i;
34 // search for the device
35 for (i = 0; i < (int)USB_DEVTABLE_LEN; i++) {
36 if (UsbDevTable[i].VenId == vendorID && UsbDevTable[i].DevId == deviceID ) {
37 *deviceName = UsbDevTable[i].ChipDesc && UsbDevTable[i].ChipDesc[0]
38 ? UsbDevTable[i].ChipDesc : NULL;
39 return;
42 *deviceName = NULL;