<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 2016年09月13日 03:11, Deb McLemore
wrote:<br>
</div>
<blockquote
cite="mid:1473707461-30930-1-git-send-email-debmc@linux.vnet.ibm.com"
type="cite">
<pre wrap="">Add defines for common usage across FWTS.
Signed-off-by: Deb McLemore <a class="moz-txt-link-rfc2396E" href="mailto:debmc@linux.vnet.ibm.com"><debmc@linux.vnet.ibm.com></a>
---
src/lib/include/fwts_devicetree.h | 10 ++++++++++
src/lib/src/fwts_devicetree.c | 4 +---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/lib/include/fwts_devicetree.h b/src/lib/include/fwts_devicetree.h
index 7c67dc5..355c0ee 100644
--- a/src/lib/include/fwts_devicetree.h
+++ b/src/lib/include/fwts_devicetree.h
@@ -28,6 +28,16 @@
#define FWTS_HAS_DEVICETREE 0
#endif
+#define DT_FS_PATH "/sys/firmware/devicetree/base"
+#define DT_LINUX_PCI_DEVICES "/sys/bus/pci/devices"
+#define DT_PROPERTY_OPAL_PCI_SLOT "ibm,slot-label"
+#define DT_PROPERTY_OPAL_SLOT_LOC "ibm,slot-location-code"
+#define DT_PROPERTY_OPAL_PART_NUM "part-number"
+#define DT_PROPERTY_OPAL_SERIAL_NUM "serial-number"
+#define DT_PROPERTY_OPAL_MANUFACTURER_ID "manufacturer-id"
+#define DT_PROPERTY_OPAL_STATUS "status"
+#define DT_PROPERTY_OPAL_VENDOR "vendor"
+
#if FWTS_HAS_DEVICETREE
int fwts_devicetree_read(fwts_framework *fwts);
diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
index 5978ab9..94367de 100644
--- a/src/lib/src/fwts_devicetree.c
+++ b/src/lib/src/fwts_devicetree.c
@@ -23,8 +23,6 @@
#include "fwts.h"
-static const char *devicetree_fs_path = "/sys/firmware/devicetree/base";
-
int fwts_devicetree_read(fwts_framework *fwts)
{
char *command, *data = NULL;
@@ -35,7 +33,7 @@ int fwts_devicetree_read(fwts_framework *fwts)
if (!fwts_firmware_has_features(FWTS_FW_FEATURE_DEVICETREE))
return FWTS_OK;
- rc = asprintf(&command, "dtc -I fs -O dtb %s", devicetree_fs_path);
+ rc = asprintf(&command, "dtc -I fs -O dtb %s", DT_FS_PATH);
if (rc < 0)
return FWTS_ERROR;
</pre>
</blockquote>
<br>
Acked-by: Ivan Hu <a class="moz-txt-link-rfc2396E"
href="mailto:ivan.hu@canonical.com"><ivan.hu@canonical.com></a><br>
</body>
</html>