summaryrefslogtreecommitdiff
path: root/lib/ipmi_hpmfwupg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipmi_hpmfwupg.c')
-rw-r--r--lib/ipmi_hpmfwupg.c15
1 files changed, 5 insertions, 10 deletions
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;