2008-10-23 02:32:37 +04:00
|
|
|
/*
|
2012-02-18 17:25:10 +04:00
|
|
|
* Copyright 2008-2012, Haiku, Inc. All Rights Reserved.
|
2008-10-23 02:32:37 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Jérôme Duval
|
|
|
|
*/
|
|
|
|
|
2012-02-18 17:25:10 +04:00
|
|
|
|
2008-10-23 02:32:37 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2012-02-18 17:25:10 +04:00
|
|
|
#include "usbhdr.h"
|
|
|
|
|
2008-10-23 02:32:37 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
usb_get_vendor_info(uint16 vendorID, const char **vendorName)
|
|
|
|
{
|
|
|
|
int i;
|
2012-02-18 17:25:10 +04:00
|
|
|
for (i = 0; i < (int)USB_VENTABLE_LEN; i++) {
|
|
|
|
if (UsbVenTable[i].VenId == vendorID) {
|
|
|
|
*vendorName = UsbVenTable[i].VenName && UsbVenTable[i].VenName[0]
|
|
|
|
? UsbVenTable[i].VenName : NULL;
|
2008-10-23 02:32:37 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*vendorName = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2012-02-18 17:25:10 +04:00
|
|
|
usb_get_device_info(uint16 vendorID, uint16 deviceID, const char **deviceName)
|
2008-10-23 02:32:37 +04:00
|
|
|
{
|
|
|
|
int i;
|
2012-02-18 17:25:10 +04:00
|
|
|
// search for the device
|
|
|
|
for (i = 0; i < (int)USB_DEVTABLE_LEN; i++) {
|
|
|
|
if (UsbDevTable[i].VenId == vendorID && UsbDevTable[i].DevId == deviceID ) {
|
|
|
|
*deviceName = UsbDevTable[i].ChipDesc && UsbDevTable[i].ChipDesc[0]
|
|
|
|
? UsbDevTable[i].ChipDesc : NULL;
|
2008-10-23 02:32:37 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*deviceName = NULL;
|
|
|
|
}
|