mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 3608765 - Fixed big endian bug in ipmi_ek_display_carrier_connectivity.
Fixed a bug where the carrier connectivity point to point descriptor was not being displayed properly when compiled on big endian machines. Commit for Dan Gora
This commit is contained in:
parent
1e96d20277
commit
0411186443
@ -803,7 +803,7 @@ ipmi_ek_display_carrier_connectivity( struct ipmi_ek_multi_header * record )
|
|||||||
{
|
{
|
||||||
int return_value = ERROR_STATUS;
|
int return_value = ERROR_STATUS;
|
||||||
struct fru_picmgext_carrier_p2p_record rsc_desc;
|
struct fru_picmgext_carrier_p2p_record rsc_desc;
|
||||||
struct fru_picmgext_carrier_p2p_descriptor port_desc;
|
struct fru_picmgext_carrier_p2p_descriptor *port_desc;
|
||||||
|
|
||||||
if ( record == NULL ){
|
if ( record == NULL ){
|
||||||
lprintf(LOG_ERR, "P2P connectivity record is invalid\n");
|
lprintf(LOG_ERR, "P2P connectivity record is invalid\n");
|
||||||
@ -848,20 +848,32 @@ ipmi_ek_display_carrier_connectivity( struct ipmi_ek_multi_header * record )
|
|||||||
(rsc_desc.resource_id & 0x0f));
|
(rsc_desc.resource_id & 0x0f));
|
||||||
}
|
}
|
||||||
while ( rsc_desc.p2p_count > 0 ){
|
while ( rsc_desc.p2p_count > 0 ){
|
||||||
memcpy ( &port_desc, &record->data[offset],
|
unsigned char data[3];
|
||||||
sizeof ( struct fru_picmgext_carrier_p2p_descriptor ) );
|
#ifndef WORDS_BIGENDIAN
|
||||||
offset += sizeof ( struct fru_picmgext_carrier_p2p_descriptor );
|
data[0] = record->data[offset+0];
|
||||||
if ( (port_desc.remote_resource_id & AMC_MODULE) == AMC_MODULE ){
|
data[1] = record->data[offset+1];
|
||||||
printf("\tPort %d =====> %s, Port %d\n", port_desc.local_port,
|
data[2] = record->data[offset+2];
|
||||||
val2str( (port_desc.remote_resource_id & 0x0f),
|
#else
|
||||||
ipmi_ekanalyzer_module_type), port_desc.remote_port );
|
data[0] = record->data[offset+2];
|
||||||
}
|
data[1] = record->data[offset+1];
|
||||||
else{
|
data[2] = record->data[offset+0];
|
||||||
printf("\tPort %d =====> On Carrier Device ID %d, Port %d\n",
|
#endif
|
||||||
port_desc.local_port,(port_desc.remote_resource_id & 0x0f),
|
port_desc = (struct fru_picmgext_carrier_p2p_descriptor*)data;
|
||||||
port_desc.remote_port );
|
offset += sizeof (struct fru_picmgext_carrier_p2p_descriptor);
|
||||||
}
|
if ((port_desc->remote_resource_id & AMC_MODULE) == AMC_MODULE) {
|
||||||
rsc_desc.p2p_count--;
|
printf("\tPort %d =====> %s, Port %d\n",
|
||||||
|
port_desc->local_port,
|
||||||
|
val2str( (port_desc->remote_resource_id & 0x0f),
|
||||||
|
ipmi_ekanalyzer_module_type),
|
||||||
|
port_desc->remote_port);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("\tPort %d =====> On Carrier Device ID %d, Port %d\n",
|
||||||
|
port_desc->local_port,
|
||||||
|
(port_desc->remote_resource_id & 0x0f),
|
||||||
|
port_desc->remote_port);
|
||||||
|
}
|
||||||
|
rsc_desc.p2p_count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return_value = OK_STATUS;
|
return_value = OK_STATUS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user