mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
Fixed HPM firmware activation via IOL
Fake a timeout after IOL session re-open to force get upgrade status retry Added retries on 0xD3 completion code Added a provision for sub minor version, incremented to 1.0.1
This commit is contained in:
parent
6a269e5741
commit
513dabb395
@ -115,8 +115,9 @@ extern int verbose;
|
|||||||
/*
|
/*
|
||||||
* Agent version
|
* Agent version
|
||||||
*/
|
*/
|
||||||
#define HPMFWUPG_VERSION_MAJOR 1
|
#define HPMFWUPG_VERSION_MAJOR 1
|
||||||
#define HPMFWUPG_VERSION_MINOR 0
|
#define HPMFWUPG_VERSION_MINOR 0
|
||||||
|
#define HPMFWUPG_VERSION_SUBMINOR 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HPM.1 FIRMWARE UPGRADE COMMANDS (part of PICMG)
|
* HPM.1 FIRMWARE UPGRADE COMMANDS (part of PICMG)
|
||||||
@ -3051,42 +3052,37 @@ struct ipmi_rs * HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
|
|||||||
lprintf(LOG_DEBUG,"HPM: upg/rollback status firmware API called");
|
lprintf(LOG_DEBUG,"HPM: upg/rollback status firmware API called");
|
||||||
lprintf(LOG_DEBUG,"HPM: try to re-open IOL session");
|
lprintf(LOG_DEBUG,"HPM: try to re-open IOL session");
|
||||||
|
|
||||||
/* force session re-open */
|
if ( intf->target_addr == intf->my_addr )
|
||||||
intf->opened = 0;
|
{
|
||||||
intf->session->authtype = IPMI_SESSION_AUTHTYPE_NONE;
|
/* force session re-open */
|
||||||
intf->session->session_id = 0;
|
intf->opened = 0;
|
||||||
intf->session->in_seq = 0;
|
intf->session->authtype = IPMI_SESSION_AUTHTYPE_NONE;
|
||||||
intf->session->active = 0;
|
intf->session->session_id = 0;
|
||||||
|
intf->session->in_seq = 0;
|
||||||
|
intf->session->active = 0;
|
||||||
|
|
||||||
while
|
while
|
||||||
(
|
(
|
||||||
intf->open(intf) == HPMFWUPG_ERROR
|
intf->open(intf) == HPMFWUPG_ERROR
|
||||||
&&
|
&&
|
||||||
inaccessTimeoutCounter < inaccessTimeout
|
inaccessTimeoutCounter < inaccessTimeout
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
inaccessTimeoutCounter += time(NULL) - timeoutSec1;
|
inaccessTimeoutCounter += time(NULL) - timeoutSec1;
|
||||||
timeoutSec1 = time(NULL);
|
timeoutSec1 = time(NULL);
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
}
|
}
|
||||||
|
/* Fake timeout to retry command */
|
||||||
if ( inaccessTimeoutCounter < inaccessTimeout )
|
|
||||||
{
|
|
||||||
fakeRsp.ccode = HPMFWUPG_COMMAND_IN_PROGRESS;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fakeRsp.ccode = 0xc3;
|
fakeRsp.ccode = 0xc3;
|
||||||
|
rsp = &fakeRsp;
|
||||||
}
|
}
|
||||||
rsp = &fakeRsp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle inaccessibility timeout (rsp = NULL if IOL) */
|
/* Handle inaccessibility timeout (rsp = NULL if IOL) */
|
||||||
if ( rsp == NULL || rsp->ccode == 0xff || rsp->ccode == 0xc3 )
|
if ( rsp == NULL || rsp->ccode == 0xff || rsp->ccode == 0xc3 || rsp->ccode == 0xd3 )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( inaccessTimeoutCounter < inaccessTimeout )
|
if ( inaccessTimeoutCounter < inaccessTimeout )
|
||||||
{
|
{
|
||||||
timeoutSec2 = time(NULL);
|
timeoutSec2 = time(NULL);
|
||||||
@ -3095,7 +3091,7 @@ struct ipmi_rs * HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
|
|||||||
inaccessTimeoutCounter += timeoutSec2 - timeoutSec1;
|
inaccessTimeoutCounter += timeoutSec2 - timeoutSec1;
|
||||||
timeoutSec1 = time(NULL);
|
timeoutSec1 = time(NULL);
|
||||||
}
|
}
|
||||||
|
usleep(100000);
|
||||||
retry = 1;
|
retry = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3114,6 +3110,7 @@ struct ipmi_rs * HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
|
|||||||
timeoutSec1 = time(NULL);
|
timeoutSec1 = time(NULL);
|
||||||
upgradeTimeoutCounter += timeoutSec2 - timeoutSec1;
|
upgradeTimeoutCounter += timeoutSec2 - timeoutSec1;
|
||||||
}
|
}
|
||||||
|
usleep(100000);
|
||||||
retry = 1;
|
retry = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3241,8 +3238,8 @@ int ipmi_hpmfwupg_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
lprintf(LOG_DEBUG,"ipmi_hpmfwupg_main()");
|
lprintf(LOG_DEBUG,"ipmi_hpmfwupg_main()");
|
||||||
|
|
||||||
|
|
||||||
lprintf(LOG_NOTICE,"\nPICMG HPM.1 Upgrade Agent %d.%d: \n",
|
lprintf(LOG_NOTICE,"\nPICMG HPM.1 Upgrade Agent %d.%d.%d: \n",
|
||||||
HPMFWUPG_VERSION_MAJOR, HPMFWUPG_VERSION_MINOR);
|
HPMFWUPG_VERSION_MAJOR, HPMFWUPG_VERSION_MINOR, HPMFWUPG_VERSION_SUBMINOR);
|
||||||
|
|
||||||
if ( (argc == 0) || (strcmp(argv[0], "help") == 0) )
|
if ( (argc == 0) || (strcmp(argv[0], "help") == 0) )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user