[PATCH 1/5] Add pci_read_vpd() function and internal read_vpd() method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/nbsd-libpci.c |    1 +
 lib/obsd-device.c |    1 +
 lib/pci.h         |    1 +
 lib/proc.c        |    1 +
 lib/sysfs.c       |    1 +
 11 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/lib/access.c b/lib/access.c
index d9032a7..c7040c1 100644
--- a/lib/access.c
+++ b/lib/access.c
@@ -102,6 +102,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..e645f9a 100644
--- a/lib/aix-device.c
+++ b/lib/aix-device.c
@@ -268,6 +268,7 @@ struct pci_methods pm_aix_device = {
   aix_scan,
   pci_generic_fill_info,
   aix_read,
+  NULL,
   aix_write,
   NULL,                                 /* dev_init */
   NULL                                  /* dev_cleanup */
diff --git a/lib/dump.c b/lib/dump.c
index 69a99c8..2c8923c 100644
--- a/lib/dump.c
+++ b/lib/dump.c
@@ -172,6 +172,7 @@ struct pci_methods pm_dump = {
   dump_scan,
   pci_generic_fill_info,
   dump_read,
+  NULL,
   dump_write,
   NULL,					/* init_dev */
   dump_cleanup_dev
diff --git a/lib/fbsd-device.c b/lib/fbsd-device.c
index 742c641..965cbee 100644
--- a/lib/fbsd-device.c
+++ b/lib/fbsd-device.c
@@ -163,6 +163,7 @@ struct pci_methods pm_fbsd_device = {
   pci_generic_scan,
   pci_generic_fill_info,
   fbsd_read,
+  NULL,
   fbsd_write,
   NULL,                                 /* dev_init */
   NULL                                  /* dev_cleanup */
diff --git a/lib/i386-ports.c b/lib/i386-ports.c
index 666b749..1861ca8 100644
--- a/lib/i386-ports.c
+++ b/lib/i386-ports.c
@@ -264,6 +264,7 @@ struct pci_methods pm_intel_conf1 = {
   pci_generic_scan,
   pci_generic_fill_info,
   conf1_read,
+  NULL,
   conf1_write,
   NULL,					/* init_dev */
   NULL					/* cleanup_dev */
@@ -279,6 +280,7 @@ struct pci_methods pm_intel_conf2 = {
   pci_generic_scan,
   pci_generic_fill_info,
   conf2_read,
+  NULL,
   conf2_write,
   NULL,					/* init_dev */
   NULL					/* cleanup_dev */
diff --git a/lib/internal.h b/lib/internal.h
index 62c8f33..0296eb6 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -25,6 +25,7 @@ struct pci_methods {
   void (*scan)(struct pci_access *);
   int (*fill_info)(struct pci_dev *, int flags);
   int (*read)(struct pci_dev *, int pos, byte *buf, int len);
+  int (*read_vpd)(struct pci_dev *, int pos, byte *buf, int len);
   int (*write)(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/nbsd-libpci.c b/lib/nbsd-libpci.c
index 2d24c4c..5bc8d4e 100644
--- a/lib/nbsd-libpci.c
+++ b/lib/nbsd-libpci.c
@@ -150,6 +150,7 @@ struct pci_methods pm_nbsd_libpci = {
   pci_generic_scan,
   pci_generic_fill_info,
   nbsd_read,
+  NULL,
   nbsd_write,
   NULL,                                 /* dev_init */
   NULL                                  /* dev_cleanup */
diff --git a/lib/obsd-device.c b/lib/obsd-device.c
index 62395b3..ae8857d 100644
--- a/lib/obsd-device.c
+++ b/lib/obsd-device.c
@@ -145,6 +145,7 @@ struct pci_methods pm_obsd_device = {
   pci_generic_scan,
   pci_generic_fill_info,
   obsd_read,
+  NULL,
   obsd_write,
   NULL,                                 /* dev_init */
   NULL                                  /* dev_cleanup */
diff --git a/lib/pci.h b/lib/pci.h
index 8f4773f..deef985 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -144,6 +144,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..4226004 100644
--- a/lib/proc.c
+++ b/lib/proc.c
@@ -196,6 +196,7 @@ struct pci_methods pm_linux_proc = {
   proc_scan,
   pci_generic_fill_info,
   proc_read,
+  NULL,
   proc_write,
   NULL,					/* init_dev */
   proc_cleanup_dev
diff --git a/lib/sysfs.c b/lib/sysfs.c
index ea386fa..6a48e51 100644
--- a/lib/sysfs.c
+++ b/lib/sysfs.c
@@ -259,6 +259,7 @@ struct pci_methods pm_linux_sysfs = {
   sysfs_scan,
   pci_generic_fill_info,
   sysfs_read,
+  NULL,
   sysfs_write,
   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

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux