00001 /* 00002 * kernel_drivers/adi_buses/pci/pcibus_names.c 00003 * 00004 * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl> 00005 * All Rights Reserved 00006 * 00007 * Date: 2004/06 00008 * Author: Lukasz Dembinski 00009 * Info: pcibus_names.c core file 00010 * Contact: mailto: <dembol@nasa.com.pl> 00011 * 00012 */ 00013 00014 #include <agnix/agnix.h> 00015 #include <agnix/adi/adi.h> 00016 00017 extern struct pcibus_vendor_name_s pcibus_vendor_names[]; 00018 extern struct pcibus_device_name_s pcibus_device_names[]; 00019 00020 const char *pcibus_device_name(u32 vendor_id, u32 device_id) 00021 { 00022 int i = 0; 00023 00024 while(pcibus_device_names[i].device_name != NULL) { 00025 if ((pcibus_device_names[i].vendor_id == vendor_id) && 00026 (pcibus_device_names[i].device_id == device_id)) { 00027 return pcibus_device_names[i].device_name; 00028 } 00029 00030 i++; 00031 } 00032 00033 return NULL; 00034 } 00035 00036 const char *pcibus_vendor_name(u32 vendor_id) 00037 { 00038 int i = 0; 00039 00040 while(pcibus_vendor_names[i].vendor_name != NULL) { 00041 if (pcibus_vendor_names[i].vendor_id == vendor_id) { 00042 return pcibus_vendor_names[i].vendor_name; 00043 } 00044 00045 i++; 00046 } 00047 00048 return NULL; 00049 }