comparison vidix/pci_names.c @ 30052:fb44c9cb05fa

Do not auto-generate the C code to handle PCI vendor and device names. This part of the code does not change so there is no point in generating it.
author diego
date Sun, 20 Dec 2009 21:11:39 +0000
parents
children
comparison
equal deleted inserted replaced
30051:605c84da5b2c 30052:fb44c9cb05fa
1 /*
2 * VIDIX - VIDeo Interface for *niX.
3 *
4 * This file is part of MPlayer.
5 *
6 * MPlayer is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * MPlayer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #include <stddef.h>
22 #include "pci_names.h"
23 #include "pci_vendor_ids.h"
24
25 const char *pci_vendor_name(unsigned short id)
26 {
27 unsigned i;
28 for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {
29 if (vendor_ids[i].id == id)
30 return vendor_ids[i].name;
31 }
32 return NULL;
33 }
34
35 const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)
36 {
37 unsigned i, j;
38 for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {
39 if (vendor_ids[i].id == vendor_id) {
40 j = 0;
41 while (vendor_ids[i].dev_list[j].id != 0xFFFF) {
42 if (vendor_ids[i].dev_list[j].id == device_id)
43 return vendor_ids[i].dev_list[j].name;
44 j++;
45 };
46 break;
47 }
48 }
49 return NULL;
50 }