Signed-off-by: Ben Hutchings <bhutchings@xxxxxxxxxxxxxx> --- lib/access.c | 6 ++++++ lib/aix-device.c | 1 + lib/dump.c | 1 + lib/fbsd-device.c | 1 + lib/i386-ports.c | 2 ++ lib/internal.h | 1 + lib/libpci.ver | 1 + lib/nbsd-libpci.c | 1 + lib/obsd-device.c | 1 + lib/pci.h | 1 + lib/proc.c | 1 + lib/sysfs.c | 1 + 12 files changed, 18 insertions(+), 0 deletions(-) diff --git a/lib/access.c b/lib/access.c index bd829a6..23a821c 100644 --- a/lib/access.c +++ b/lib/access.c @@ -103,6 +103,12 @@ pci_read_block(struct pci_dev *d, int pos, byte *buf, int len) return d->methods->read(d, pos, buf, len); } +int +pci_read_vpd(struct pci_dev *d, int pos, byte *buf, int len) +{ + return d->methods->read_vpd ? d->methods->read_vpd(d, pos, buf, len) : 0; +} + static inline int pci_write_data(struct pci_dev *d, void *buf, int pos, int len) { diff --git a/lib/aix-device.c b/lib/aix-device.c index cb0a974..a10bea5 100644 --- a/lib/aix-device.c +++ b/lib/aix-device.c @@ -269,6 +269,7 @@ struct pci_methods pm_aix_device = { pci_generic_fill_info, aix_read, aix_write, + NULL, /* read_vpd */ NULL, /* dev_init */ NULL /* dev_cleanup */ }; diff --git a/lib/dump.c b/lib/dump.c index 69a99c8..0196f69 100644 --- a/lib/dump.c +++ b/lib/dump.c @@ -173,6 +173,7 @@ struct pci_methods pm_dump = { pci_generic_fill_info, dump_read, dump_write, + NULL, /* read_vpd */ NULL, /* init_dev */ dump_cleanup_dev }; diff --git a/lib/fbsd-device.c b/lib/fbsd-device.c index 742c641..ab04954 100644 --- a/lib/fbsd-device.c +++ b/lib/fbsd-device.c @@ -164,6 +164,7 @@ struct pci_methods pm_fbsd_device = { pci_generic_fill_info, fbsd_read, fbsd_write, + NULL, /* read_vpd */ NULL, /* dev_init */ NULL /* dev_cleanup */ }; diff --git a/lib/i386-ports.c b/lib/i386-ports.c index 50ae615..072fac5 100644 --- a/lib/i386-ports.c +++ b/lib/i386-ports.c @@ -265,6 +265,7 @@ struct pci_methods pm_intel_conf1 = { pci_generic_fill_info, conf1_read, conf1_write, + NULL, /* read_vpd */ NULL, /* init_dev */ NULL /* cleanup_dev */ }; @@ -280,6 +281,7 @@ struct pci_methods pm_intel_conf2 = { pci_generic_fill_info, conf2_read, conf2_write, + NULL, /* read_vpd */ NULL, /* init_dev */ NULL /* cleanup_dev */ }; diff --git a/lib/internal.h b/lib/internal.h index 35ed65f..0d95109 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -33,6 +33,7 @@ struct pci_methods { int (*fill_info)(struct pci_dev *, int flags); int (*read)(struct pci_dev *, int pos, byte *buf, int len); int (*write)(struct pci_dev *, int pos, byte *buf, int len); + int (*read_vpd)(struct pci_dev *, int pos, byte *buf, int len); void (*init_dev)(struct pci_dev *); void (*cleanup_dev)(struct pci_dev *); }; diff --git a/lib/libpci.ver b/lib/libpci.ver index 68cc932..2f7dff7 100644 --- a/lib/libpci.ver +++ b/lib/libpci.ver @@ -45,4 +45,5 @@ LIBPCI_3.1 { global: pci_fill_info; pci_find_cap; + pci_read_vpd; }; diff --git a/lib/nbsd-libpci.c b/lib/nbsd-libpci.c index 2d24c4c..20d7616 100644 --- a/lib/nbsd-libpci.c +++ b/lib/nbsd-libpci.c @@ -151,6 +151,7 @@ struct pci_methods pm_nbsd_libpci = { pci_generic_fill_info, nbsd_read, nbsd_write, + NULL, /* read_vpd */ NULL, /* dev_init */ NULL /* dev_cleanup */ }; diff --git a/lib/obsd-device.c b/lib/obsd-device.c index 62395b3..dc68422 100644 --- a/lib/obsd-device.c +++ b/lib/obsd-device.c @@ -146,6 +146,7 @@ struct pci_methods pm_obsd_device = { pci_generic_fill_info, obsd_read, obsd_write, + NULL, /* read_vpd */ NULL, /* dev_init */ NULL /* dev_cleanup */ }; diff --git a/lib/pci.h b/lib/pci.h index d7f7fee..c9c2c5f 100644 --- a/lib/pci.h +++ b/lib/pci.h @@ -145,6 +145,7 @@ u8 pci_read_byte(struct pci_dev *, int pos) PCI_ABI; /* Access to configuration u16 pci_read_word(struct pci_dev *, int pos) PCI_ABI; u32 pci_read_long(struct pci_dev *, int pos) PCI_ABI; int pci_read_block(struct pci_dev *, int pos, u8 *buf, int len) PCI_ABI; +int pci_read_vpd(struct pci_dev *d, int pos, u8 *buf, int len) PCI_ABI; int pci_write_byte(struct pci_dev *, int pos, u8 data) PCI_ABI; int pci_write_word(struct pci_dev *, int pos, u16 data) PCI_ABI; int pci_write_long(struct pci_dev *, int pos, u32 data) PCI_ABI; diff --git a/lib/proc.c b/lib/proc.c index 1b44b4e..bf877c4 100644 --- a/lib/proc.c +++ b/lib/proc.c @@ -197,6 +197,7 @@ struct pci_methods pm_linux_proc = { pci_generic_fill_info, proc_read, proc_write, + NULL, /* read_vpd */ NULL, /* init_dev */ proc_cleanup_dev }; diff --git a/lib/sysfs.c b/lib/sysfs.c index ea386fa..695f1c2 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -260,6 +260,7 @@ struct pci_methods pm_linux_sysfs = { pci_generic_fill_info, sysfs_read, sysfs_write, + NULL, /* read_vpd */ NULL, /* init_dev */ sysfs_cleanup_dev }; -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html