From 361000f61f3691cc5b970587366f8154610d2771 Mon Sep 17 00:00:00 2001 From: Vipin K Parashar Date: Sat, 27 Feb 2016 02:13:26 +0530 Subject: ipmi: Log exact NetFn value in OPAL logs As per IPMI message format NetFn value in present in first 6 bits while last 2 bits contain LUN value. This needs to be taken care while printing NetFn value in OPAL logs which is useful while debugging fails. [root@fir01 /]# ipmitool raw 0x0a 0x48 47 b1 d0 56 [root@fir01 /]# >From OPAL Logs --------------- [133969609199,7] BT: seq 0x3d netfn 0x0a cmd 0x48: Message sent to host [133975465455,7] BT: seq 0x3d netfn 0x0a cmd 0x48: IPMI MSG done >From BMC Logs -------------- IPMIMain: [693 WARNING][corecmdselect.c:913] Request: Channel:f; Netfn:a; Cmd:48; IPMIMain: [693 INFO][corecmdselect.c:924] Response: Channel:f; Netfn:a; Cmd:48; Data:0 47 b1 d0 56 Signed-off-by: Vipin K Parashar Reviewed-by: Cyril Bur Signed-off-by: Stewart Smith --- hw/bt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hw/bt.c') diff --git a/hw/bt.c b/hw/bt.c index 3325f69..ca8bd1e 100644 --- a/hw/bt.c +++ b/hw/bt.c @@ -15,6 +15,7 @@ */ #define pr_fmt(fmt) "BT: " fmt + #include #include #include @@ -80,7 +81,7 @@ #define _BT_Q_LOG(level, msg, fmt, args...) \ do { if (msg) \ prlog(level, "seq 0x%02x netfn 0x%02x cmd 0x%02x: " fmt "\n", \ - (msg)->seq, (msg)->ipmi_msg.netfn, (msg)->ipmi_msg.cmd, ##args); \ + (msg)->seq, ((msg)->ipmi_msg.netfn >> 2), (msg)->ipmi_msg.cmd, ##args); \ else \ prlog(level, "seq 0x?? netfn 0x?? cmd 0x??: " fmt "\n", ##args); \ } while(0) @@ -346,7 +347,7 @@ static void bt_get_resp(void) if (!bt_msg) { /* A response to a message we no longer care about. */ prlog(PR_INFO, "Nobody cared about a response to an BT/IPMI message" - "(seq 0x%02x netfn 0x%02x cmd 0x%02x)\n", seq, netfn, cmd); + "(seq 0x%02x netfn 0x%02x cmd 0x%02x)\n", seq, (netfn >> 2), cmd); bt_flush_msg(); return; } -- cgit v1.1