}
struct pci_methods pm_aix_device = {
- "AIX-device",
+ "aix-device",
+ "AIX /dev/pci[0-n]",
NULL,
aix_detect,
aix_init,
struct pci_methods pm_dump = {
"dump",
+ "Reading of register dumps (set the `dump.name' parameter)",
dump_config,
dump_detect,
dump_init,
}
struct pci_methods pm_fbsd_device = {
- "FreeBSD-device",
+ "fbsd-device",
+ "FreeBSD /dev/pci device",
fbsd_config,
fbsd_detect,
fbsd_init,
}
struct pci_methods pm_intel_conf1 = {
- "Intel-conf1",
+ "intel-conf1",
+ "Raw I/O port access using Intel conf1 interface",
NULL, /* config */
conf1_detect,
conf12_init,
};
struct pci_methods pm_intel_conf2 = {
- "Intel-conf2",
+ "intel-conf2",
+ "Raw I/O port access using Intel conf2 interface",
NULL, /* config */
conf2_detect,
conf12_init,
{
}
+int
+pci_lookup_method(char *name)
+{
+ int i;
+
+ for (i=0; i<PCI_ACCESS_MAX; i++)
+ if (pci_methods[i] && !strcmp(pci_methods[i]->name, name))
+ return i;
+ return -1;
+}
+
+char *
+pci_get_method_name(int index)
+{
+ if (index < 0 || index >= PCI_ACCESS_MAX)
+ return NULL;
+ else if (!pci_methods[index])
+ return "";
+ else
+ return pci_methods[index]->name;
+}
+
struct pci_access *
pci_alloc(void)
{
struct pci_methods {
char *name;
+ char *help;
void (*config)(struct pci_access *);
int (*detect)(struct pci_access *);
void (*init)(struct pci_access *);
}
struct pci_methods pm_nbsd_libpci = {
- "NetBSD-libpci",
+ "nbsd-libpci",
+ "NetBSD libpci",
nbsd_config,
nbsd_detect,
nbsd_init,
}
struct pci_methods pm_obsd_device = {
- "OpenBSD-device",
+ "obsd-device",
+ "/dev/pci on OpenBSD",
obsd_config,
obsd_detect,
obsd_init,
struct pci_dev *pci_get_dev(struct pci_access *acc, int domain, int bus, int dev, int func); /* Raw access to specified device */
void pci_free_dev(struct pci_dev *);
+/* Names of access methods */
+int pci_lookup_method(char *name); /* Returns -1 if not found */
+char *pci_get_method_name(int index); /* Returns "" if unavailable, NULL if index out of range */
+
/*
* Named parameters
*/
}
struct pci_methods pm_linux_proc = {
- "Linux-proc",
+ "linux-proc",
+ "The proc file system on Linux",
proc_config,
proc_detect,
proc_init,
}
struct pci_methods pm_linux_sysfs = {
- "Linux-sysfs",
+ "linux-sysfs",
+ "The sys filesystem on Linux",
sysfs_config,
sysfs_detect,
sysfs_init,