From 914159b3b514964583b8d1ab617d9af393d6c643 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Wed, 17 Nov 2004 23:34:29 +0000 Subject: [PATCH] handle bridged reponses by matching the request and response commands don't send pings to sm boards --- ipmitool/src/plugins/lan/lan.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ipmitool/src/plugins/lan/lan.c b/ipmitool/src/plugins/lan/lan.c index c472b48..e183ac0 100644 --- a/ipmitool/src/plugins/lan/lan.c +++ b/ipmitool/src/plugins/lan/lan.c @@ -38,11 +38,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -497,13 +497,21 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf) if (verbose > 2) printf("IPMI Request Match found\n"); if (intf->target_addr != IPMI_BMC_SLAVE_ADDR) { - if (verbose > 2) - printf("Bridged cmd resp: %s\n", buf2str(&rsp->data[x],rsp->data_len)); + if ((verbose > 2) && rsp->data_len) + printf("Bridged cmd %02x resp: %s\n", + rsp->payload.ipmi_response.cmd, + buf2str(&rsp->data[x],rsp->data_len)); /* bridged command: lose extra header */ - x += sizeof(rsp->payload.ipmi_response); - if (verbose && rsp->data[x-1] != 0) - printf("WARNING: Bridged cmd ccode = 0x%02x\n", - rsp->data[x-1]); + if (rsp->payload.ipmi_response.cmd == 0x34) { + entry->req.msg.cmd = entry->req.msg.target_cmd; + rsp = ipmi_lan_recv_packet(intf); + continue; + } else { + //x += sizeof(rsp->payload.ipmi_response); + if (verbose && rsp->data[x-1] != 0) + printf("WARNING: Bridged cmd ccode = 0x%02x\n", + rsp->data[x-1]); + } } ipmi_req_remove_entry(rsp->payload.ipmi_response.rq_seq, rsp->payload.ipmi_response.cmd); @@ -623,6 +631,7 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req) msg[len++] = IPMI_REMOTE_SWID; msg[len++] = curr_seq << 2; msg[len++] = 0x34; /* Send Message rqst */ + entry->req.msg.target_cmd = entry->req.msg.cmd; /* Save target command */ entry->req.msg.cmd = 0x34; /* (fixup request entry) */ msg[len++] = 0x40; /* Track request, Channel=IPMB */ cs = len; @@ -1267,8 +1276,11 @@ ipmi_lan_activate_session(struct ipmi_intf * intf) { int rc; - /* don't fail on ping because its not always supported */ - ipmi_lan_ping(intf); + /* don't fail on ping because its not always supported. + * Supermicro's IPMI LAN 1.5 cards don't tolerate pings. + */ + if (!intf->session->authspecial) + ipmi_lan_ping(intf); if (intf->thump) ipmi_lan_thump_first(intf);