Add processor callout when BMC has no comm to an OCC

The non-informational PEL indicating that communication has been lost to
the OCC did not have any callouts.
This commit will add a callout for the processor that it was unable to
communicate with.

Example:
'''
    "Error Details": {
        "Message":              "BMC failed to communicate with the OCC"
    },
    "Valid Word Count":         "0x09",
    "Reference Code":           "BD572684",
    "Hex Word 2":               "00000055",
    "Hex Word 3":               "2E2D0010",
    "Hex Word 4":               "00000000",
    "Hex Word 5":               "00000000",
    "Hex Word 6":               "00000000",
    "Hex Word 7":               "00000000",
    "Hex Word 8":               "00000000",
    "Hex Word 9":               "00000000",
    "Callout Section": {
        "Callout Count":        "1",
        "Callouts": [{
            "FRU Type":         "Normal Hardware FRU",
            "Priority":         "Mandatory, replace all with this type as a unit",
            "Location Code":    "U78DA.ND0.WZS003T-P0-C15",
            "Part Number":      "F201110",
            "CCIN":             "5C67",
            "Serial Number":    "YA39AAAA1828"
        }]
    }
'''

A
Verified on Rainier.

Change-Id: Ia26668af568238d78263b81d16fd30a849f67134
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_errors.hpp b/occ_errors.hpp
index e3ae412..57fc6c8 100644
--- a/occ_errors.hpp
+++ b/occ_errors.hpp
@@ -74,16 +74,20 @@
          *  @param[in] path - the DBus error path
          *  @param[in] err - Optional error return code
          *  @param[in] callout - Optional PEL callout path
+         *  @param[in] isInventory - true if the callout path is an
+         * inventory path, false if it is a device path
          */
-        Descriptor(const char* path, int err = 0,
-                   const char* callout = nullptr) :
-            log(true), err(err), callout(callout), path(path)
+        Descriptor(const char* path, int err = 0, const char* callout = nullptr,
+                   const bool isInventory = false) :
+            log(true), err(err), callout(callout), path(path),
+            isInventoryCallout(isInventory)
         {}
 
         bool log;
         int err;
         const char* callout;
         const char* path;
+        bool isInventoryCallout;
     };
 
     /** @brief Starts to monitor for error conditions
diff --git a/occ_ffdc.cpp b/occ_ffdc.cpp
index 763660f..d2ad833 100644
--- a/occ_ffdc.cpp
+++ b/occ_ffdc.cpp
@@ -96,7 +96,7 @@
 }
 
 void FFDC::createOCCResetPEL(unsigned int instance, const char* path, int err,
-                             const char* callout)
+                             const char* callout, const bool isInventoryCallout)
 {
     std::map<std::string, std::string> additionalData;
 
@@ -107,16 +107,28 @@
         additionalData.emplace("CALLOUT_ERRNO", std::to_string(-err));
     }
 
+    lg2::info("Creating OCC Reset PEL for OCC{INST}: {PATH}", "INST", instance,
+              "PATH", path);
+
     if (callout)
     {
-        additionalData.emplace("CALLOUT_DEVICE_PATH", std::string(callout));
+        if (isInventoryCallout)
+        {
+            lg2::info("adding inventory callout path {COPATH}", "COPATH",
+                      std::string(callout));
+            additionalData.emplace("CALLOUT_INVENTORY_PATH",
+                                   std::string(callout));
+        }
+        else
+        {
+            lg2::info("adding device callout path {COPATH}, errno:{ERRNO}",
+                      "COPATH", std::string(callout), "ERRNO", err);
+            additionalData.emplace("CALLOUT_DEVICE_PATH", std::string(callout));
+        }
     }
 
     additionalData.emplace("OCC", std::to_string(instance));
 
-    lg2::info("Creating OCC Reset PEL for OCC{INST}: {PATH}", "INST", instance,
-              "PATH", path);
-
     auto& bus = utils::getBus();
 
     try
diff --git a/occ_ffdc.hpp b/occ_ffdc.hpp
index 7578e4d..072452d 100644
--- a/occ_ffdc.hpp
+++ b/occ_ffdc.hpp
@@ -123,9 +123,12 @@
      * @param[in] path - the DBus error path
      * @param[in] err - the error return code
      * @param[in] callout - the PEL callout path
+     * @param[in] isInventoryCallout - true if the callout is an inventory path
+     * or false if it is a device path
      */
     static void createOCCResetPEL(unsigned int instance, const char* path,
-                                  int err, const char* callout);
+                                  int err, const char* deviceCallout,
+                                  const bool isInventoryCallout);
 
     /**
      * @brief Create a file containing the latest journal traces for the
diff --git a/occ_status.cpp b/occ_status.cpp
index c664d11..220fcdd 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -157,7 +157,8 @@
 
     if (d.log)
     {
-        FFDC::createOCCResetPEL(instance, d.path, d.err, d.callout);
+        FFDC::createOCCResetPEL(instance, d.path, d.err, d.callout,
+                                d.isInventoryCallout);
     }
 
     // This would deem OCC inactive
@@ -575,7 +576,9 @@
             stateValid = false;
 
             // Disable due to OCC comm failure and reset to try recovering
-            deviceError(Error::Descriptor(OCC_COMM_ERROR_PATH));
+            // (processor callout will be added)
+            deviceError(Error::Descriptor(OCC_COMM_ERROR_PATH, ECOMM,
+                                          procPath.c_str(), true));
 
             // Reset retry count (for next attempt after recovery)
             currentOccReadRetriesCount = occReadRetries;