summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pcivar.h
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2006-10-09 16:15:56 +0000
committerjmg <jmg@FreeBSD.org>2006-10-09 16:15:56 +0000
commit6a8dfa76182b17f26de62b30dea11f79111400b7 (patch)
tree1d727b5091a8658d90d11ec0750cf847f4a210f6 /sys/dev/pci/pcivar.h
parent03ea52e1daed73beb0329e7b08c841ce9c831f6d (diff)
downloadFreeBSD-src-6a8dfa76182b17f26de62b30dea11f79111400b7.zip
FreeBSD-src-6a8dfa76182b17f26de62b30dea11f79111400b7.tar.gz
provide routines to access VPD data at the PCI layer...
remove sk's own implementation, and use the new calls to get the data... Reviewed by: -arch
Diffstat (limited to 'sys/dev/pci/pcivar.h')
-rw-r--r--sys/dev/pci/pcivar.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index ade206a..fc37941 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -59,6 +59,27 @@ struct pcicfg_pp {
uint8_t pp_data; /* config space address of PCI power data reg */
};
+struct vpd_readonly {
+ char keyword[2];
+ char *value;
+};
+
+struct vpd_write {
+ char keyword[2];
+ char *value;
+ int start;
+ int len;
+};
+
+struct pcicfg_vpd {
+ uint8_t vpd_reg; /* base register, + 2 for addr, + 4 data */
+ char *vpd_ident; /* string identifier */
+ int vpd_rocnt;
+ struct vpd_readonly *vpd_ros;
+ int vpd_wcnt;
+ struct vpd_write *vpd_w;
+};
+
/* Interesting values for PCI MSI */
struct pcicfg_msi {
uint16_t msi_ctrl; /* Message Control */
@@ -103,6 +124,7 @@ typedef struct pcicfg {
uint8_t func; /* config space function number */
struct pcicfg_pp pp; /* pci power management */
+ struct pcicfg_vpd vpd; /* pci vital product data */
struct pcicfg_msi msi; /* pci msi */
} pcicfgregs;
@@ -292,6 +314,18 @@ pci_disable_io(device_t dev, int space)
return(PCI_DISABLE_IO(device_get_parent(dev), dev, space));
}
+static __inline int
+pci_get_vpd_ident(device_t dev, const char **identptr)
+{
+ return(PCI_GET_VPD_IDENT(device_get_parent(dev), dev, identptr));
+}
+
+static __inline int
+pci_get_vpd_readonly(device_t dev, const char *kw, const char **identptr)
+{
+ return(PCI_GET_VPD_READONLY(device_get_parent(dev), dev, kw, identptr));
+}
+
/*
* Check if the address range falls within the VGA defined address range(s)
*/
OpenPOWER on IntegriCloud