Fix OCC response checksum calculation

The OCC checksum calculation should be ignoring overflow.

Removed redundant trace of the occActive state:
'''
Aug 23 18:38:52 rain100bmc openpower-occ-control[6515]: updateOCCActive: OCC0 active=true
Aug 23 18:38:52 rain100bmc openpower-occ-control[6515]: Status::occActive OCC0 changed to true
'''

Added trace of first 4 bytes of data for pass-through commands:
'''
Aug 23 19:19:30 rain100bmc openpower-occ-control[27848]: PassThrough::send() Sending 0x00 command to OCC0 (data len=1, data=0x20)
Aug 23 19:19:40 rain100bmc openpower-occ-control[27848]: PassThrough::send() Sending 0x40 command to OCC0 (data len=5, data=0x07001000...)
'''

Change-Id: I632b0e0af214858e15f3d5c196723dc6ffe12445
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_command.cpp b/occ_command.cpp
index 5ab5e12..0b9faa1 100644
--- a/occ_command.cpp
+++ b/occ_command.cpp
@@ -211,15 +211,12 @@
             const unsigned int csumIndex = response.size() - 2;
             const uint32_t rspChecksum =
                 (response[csumIndex] << 8) + response[csumIndex + 1];
-            uint32_t calcChecksum = 0;
+            // OCC checksum is the 2 byte sum of data (ignoring overflow)
+            uint16_t calcChecksum = 0;
             for (unsigned int index = 0; index < csumIndex; ++index)
             {
                 calcChecksum += response[index];
             }
-            while (calcChecksum > 0xFFFF)
-            {
-                calcChecksum = (calcChecksum & 0xFFFF) + (calcChecksum >> 16);
-            }
             if (calcChecksum != rspChecksum)
             {
                 log<level::ERR>(
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 932b052..ada95ef 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -560,9 +560,6 @@
         }
         else
         {
-            log<level::INFO>(std::format("updateOCCActive: OCC{} active={}",
-                                         instance, status)
-                                 .c_str());
             (*obj)->setPldmSensorReceived(true);
             return (*obj)->occActive(status);
         }
@@ -731,7 +728,8 @@
     }
     catch (const openpower::phal::exception::SbeError& e)
     {
-        log<level::ERR>("Failed to set SBE state");
+        log<level::ERR>(
+            std::format("Failed to set SBE state: {}", e.what()).c_str());
     }
 }
 
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index 5588e5a..8567784 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -83,10 +83,37 @@
         return response;
     }
 
-    log<level::INFO>(
-        std::format("PassThrough::send() Sending 0x{:02X} command to OCC{}",
-                    command.front(), occInstance)
-            .c_str());
+    if (command.size() >= 3)
+    {
+        const uint16_t dataLen = command[1] << 8 | command[2];
+        std::string dataString = "";
+        if (command.size() > 3)
+        {
+            // Trace first 4 bytes of command data
+            size_t index = 3;
+            dataString = "0x";
+            for (; (index < 7) && (index < command.size()); ++index)
+            {
+                dataString += std::format("{:02X}", command[index]);
+            }
+            if (index < command.size())
+            {
+                dataString += "...";
+            }
+        }
+        log<level::INFO>(
+            std::format(
+                "PassThrough::send() Sending 0x{:02X} command to OCC{} (data len={}, data={})",
+                command.front(), occInstance, dataLen, dataString)
+                .c_str());
+    }
+    else
+    {
+        log<level::INFO>(
+            std::format("PassThrough::send() Sending 0x{:02X} command to OCC{}",
+                        command.front(), occInstance)
+                .c_str());
+    }
     CmdStatus status = occCmd.send(command, response);
     if (status == CmdStatus::SUCCESS)
     {