Attn: Determine TI source by host running state

In cases where the TI info is not available use the host running state
to make an educated guess as to the source of the TI.

Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I95c59ecad90b3aec417a64df4eac0ac5cb50dc09
diff --git a/attn/attn_handler.cpp b/attn/attn_handler.cpp
index 693e4c8..f4454cf 100644
--- a/attn/attn_handler.cpp
+++ b/attn/attn_handler.cpp
@@ -4,6 +4,7 @@
 #include <attn/attention.hpp>
 #include <attn/attn_common.hpp>
 #include <attn/attn_config.hpp>
+#include <attn/attn_dbus.hpp>
 #include <attn/attn_handler.hpp>
 #include <attn/attn_logging.hpp>
 #include <attn/bp_handler.hpp>
@@ -257,10 +258,33 @@
             if (PDBG_TARGET_ENABLED == pdbg_target_probe(tiInfoTarget))
             {
                 sbe_mpipl_get_ti_info(tiInfoTarget, &tiInfo, &tiInfoLen);
-                if (tiInfo == nullptr)
+
+                // If TI info not available use default based on host state
+                if (nullptr == tiInfo)
                 {
-                    trace<level::INFO>("TI info data ptr is null after call");
-                    tiInfo       = (uint8_t*)defaultPhypTiInfo;
+                    trace<level::INFO>("TI info data ptr is invalid");
+
+                    HostRunningState runningState = hostRunningState();
+                    std::string stateString       = "host state unknown";
+
+                    if ((HostRunningState::Started == runningState) ||
+                        (HostRunningState::Unknown == runningState))
+                    {
+                        if (HostRunningState::Started == runningState)
+                        {
+                            stateString = "host started";
+                        }
+                        tiInfo = (uint8_t*)defaultPhypTiInfo;
+                    }
+                    else
+                    {
+                        stateString = "host not started";
+                        tiInfo      = (uint8_t*)defaultHbTiInfo;
+                    }
+
+                    // trace host state
+                    trace<level::INFO>(stateString.c_str());
+
                     tiInfoStatic = true; // using our TI info
                 }
             }