2 * The PCI Library -- ID to Name Translation
4 * Copyright (c) 1997--2014 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL v2+
8 * SPDX-License-Identifier: GPL-2.0-or-later
16 struct id_entry *next;
42 #define BUCKET_SIZE 8192
43 #define HASH_SIZE 4099
45 static inline u32 id_pair(unsigned int x, unsigned int y)
47 return ((x << 16) | y);
50 static inline unsigned int pair_first(unsigned int x)
52 return (x >> 16) & 0xffff;
55 static inline unsigned int pair_second(unsigned int x)
60 int pci_id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, int id4, char *text, enum id_entry_src src);
61 char *pci_id_lookup(struct pci_access *a, int flags, int cat, int id1, int id2, int id3, int id4);
65 int pci_id_cache_load(struct pci_access *a, int flags);
66 void pci_id_cache_dirty(struct pci_access *a);
67 void pci_id_cache_flush(struct pci_access *a);
68 void pci_id_hash_free(struct pci_access *a);
72 char *pci_id_net_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4);
76 char *pci_id_hwdb_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4);
77 void pci_id_hwdb_free(struct pci_access *a);