From 97d6a2e491c6ed08473beb2c4bac47c5cbc1201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 20 Feb 2016 02:12:40 +0100 Subject: Imported Upstream version 1.8.16 --- lib/ipmi_hpmfwupg.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'lib/ipmi_hpmfwupg.c') diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c index fbb5a62..8ada69b 100644 --- a/lib/ipmi_hpmfwupg.c +++ b/lib/ipmi_hpmfwupg.c @@ -998,7 +998,6 @@ HpmfwupgUpgradeStage(struct ipmi_intf *intf, unsigned char *pImagePtr; unsigned int actionsSize; int flagColdReset = FALSE; - time_t start,end; /* Put pointer after image header */ pImagePtr = (unsigned char*) (pFwupgCtx->pImageData + sizeof(struct HpmfwupgImageHeader) + @@ -1200,7 +1199,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components, } else { count = (unsigned short)((pDataTemp+lengthOfBlock) - pData); } - memcpy(&uploadCmd.req->data, pData, bufLength); + memcpy(&uploadCmd.req->data, pData, count); imageOffset = 0x00; blockLength = 0x00; numTxPkts++; @@ -1869,7 +1868,6 @@ HpmfwupgGetUpgradeStatus(struct ipmi_intf *intf, struct HpmfwupgUpgradeCtx *pFwupgCtx, int silent) { - int rc = HPMFWUPG_SUCCESS; struct ipmi_rs *rsp; struct ipmi_rq req; pCtx->req.picmgId = HPMFWUPG_PICMG_IDENTIFIER; @@ -2196,18 +2194,15 @@ HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req, lprintf(LOG_DEBUG, "HPM: try to re-open IOL session"); { /* force session re-open */ - intf->opened = 0; - intf->session->authtype = IPMI_SESSION_AUTHTYPE_NONE; - intf->session->session_id = 0; - intf->session->in_seq = 0; - intf->session->out_seq = 0; - intf->session->active = 0; - intf->session->retry = 10; + intf->abort = 1; + intf->close(intf); + while (intf->open(intf) == HPMFWUPG_ERROR && inaccessTimeoutCounter < inaccessTimeout) { inaccessTimeoutCounter += (time(NULL) - timeoutSec1); timeoutSec1 = time(NULL); } + /* Fake timeout to retry command */ fakeRsp.ccode = 0xc3; rsp = &fakeRsp; -- cgit v1.2.3