-static inline unsigned int id_hash(int cat, u32 id12, u32 id34)
-{
- unsigned int h;
-
- h = id12 ^ (id34 << 3) ^ (cat << 5);
- return h % HASH_SIZE;
-}
-
-static byte *id_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4)
-{
- struct id_entry *n;
- u32 id12 = id_pair(id1, id2);
- u32 id34 = id_pair(id3, id4);
-
- if (!a->id_hash)
- return NULL;
- n = a->id_hash[id_hash(cat, id12, id34)];
- while (n && (n->id12 != id12 || n->id34 != id34 || n->cat != cat))
- n = n->next;
- return n ? n->name : NULL;
-}
-
-static int id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, int id4, byte *text)
-{
- u32 id12 = id_pair(id1, id2);
- u32 id34 = id_pair(id3, id4);
- unsigned int h = id_hash(cat, id12, id34);
- struct id_entry *n = a->id_hash[h];
- int len = strlen(text);
-
- while (n && (n->id12 != id12 || n->id34 != id34 || n->cat != cat))
- n = n->next;
- if (n)
- return 1;
- n = id_alloc(a, sizeof(struct id_entry) + len);
- n->id12 = id12;
- n->id34 = id34;
- n->cat = cat;
- memcpy(n->name, text, len+1);
- n->next = a->id_hash[h];
- a->id_hash[h] = n;
- return 0;
-}
-
-static int id_hex(byte *p, int cnt)
-{
- int x = 0;
- while (cnt--)