2 * Zorro Device Name Tables
4 * Copyright (C) 1999--2000 Geert Uytterhoeven
6 * Based on the PCI version:
8 * Copyright 1992--1999 Drew Eckhardt, Frederic Potter,
9 * David Mosberger-Tang, Martin Mares
12 #include <linux/config.h>
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/types.h>
16 #include <linux/zorro.h>
19 #ifdef CONFIG_ZORRO_NAMES
21 struct zorro_prod_info {
27 struct zorro_manuf_info {
31 struct zorro_prod_info *prods;
35 * This is ridiculous, but we want the strings in
36 * the .init section so that they don't take up
37 * real memory.. Parse the same file multiple times
38 * to get all the info.
40 #define MANUF( manuf, name ) static char __manufstr_##manuf[] __initdata = name;
42 #define PRODUCT( manuf, prod, name ) static char __prodstr_##manuf##prod[] __initdata = name;
46 #define MANUF( manuf, name ) static struct zorro_prod_info __prods_##manuf[] __initdata = {
48 #define PRODUCT( manuf, prod, name ) { 0x##prod, 0, __prodstr_##manuf##prod },
51 static struct zorro_manuf_info __initdata zorro_manuf_list[] = {
52 #define MANUF( manuf, name ) { 0x##manuf, sizeof(__prods_##manuf) / sizeof(struct zorro_prod_info), __manufstr_##manuf, __prods_##manuf },
54 #define PRODUCT( manuf, prod, name )
58 #define MANUFS (sizeof(zorro_manuf_list)/sizeof(struct zorro_manuf_info))
60 void __init zorro_name_device(struct zorro_dev *dev)
62 const struct zorro_manuf_info *manuf_p = zorro_manuf_list;
64 char *name = dev->name;
67 if (manuf_p->manuf == ZORRO_MANUF(dev->id))
72 /* Couldn't find either the manufacturer nor the product */
73 sprintf(name, "Zorro device %08x", dev->id);
77 struct zorro_prod_info *prod_p = manuf_p->prods;
82 ((ZORRO_PROD(dev->id)<<8) | ZORRO_EPC(dev->id)))
88 /* Ok, found the manufacturer, but unknown product */
89 sprintf(name, "Zorro device %08x (%s)", dev->id, manuf_p->name);
94 char *n = name + sprintf(name, "%s %s", manuf_p->name, prod_p->name);
95 int nr = prod_p->seen + 1;
98 sprintf(n, " (#%d)", nr);
105 void __init zorro_name_device(struct zorro_dev *dev)