mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 3608765 - Fix indentation of ipmi_ek_create_amc_p2p_record()
Commit changes indentation and formatting in ipmi_ek_create_amc_p2p_record(). Commit for Dan Gora
This commit is contained in:
parent
d1d404fef4
commit
49784a9ec8
@ -2221,96 +2221,95 @@ ipmi_ek_display_oem_guid(
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static int
|
static int
|
||||||
ipmi_ek_create_amc_p2p_record( struct ipmi_ek_multi_header * record,
|
ipmi_ek_create_amc_p2p_record(struct ipmi_ek_multi_header * record,
|
||||||
struct ipmi_ek_amc_p2p_connectivity_record * amc_record )
|
struct ipmi_ek_amc_p2p_connectivity_record * amc_record)
|
||||||
{
|
{
|
||||||
int return_status = OK_STATUS;
|
int index_data = START_DATA_OFFSET;
|
||||||
int index_data = START_DATA_OFFSET;
|
int return_status = OK_STATUS;
|
||||||
|
|
||||||
amc_record->guid_count = record->data[index_data++];
|
amc_record->guid_count = record->data[index_data++];
|
||||||
if ( amc_record->guid_count > 0){
|
if (amc_record->guid_count > 0) {
|
||||||
int index_oem = 0;
|
int index_oem = 0;
|
||||||
amc_record->oem_guid = malloc (amc_record->guid_count * \
|
amc_record->oem_guid = malloc(amc_record->guid_count * \
|
||||||
sizeof(struct fru_picmgext_guid) );
|
sizeof(struct fru_picmgext_guid));
|
||||||
for (index_oem = 0; index_oem < amc_record->guid_count; index_oem++){
|
for (index_oem = 0; index_oem < amc_record->guid_count;
|
||||||
memcpy ( &amc_record->oem_guid[index_oem].guid,
|
index_oem++) {
|
||||||
&record->data[index_data],
|
memcpy(&amc_record->oem_guid[index_oem].guid,
|
||||||
SIZE_OF_GUID );
|
&record->data[index_data],
|
||||||
index_data += (int)SIZE_OF_GUID;
|
SIZE_OF_GUID);
|
||||||
}
|
index_data += (int)SIZE_OF_GUID;
|
||||||
amc_record->rsc_id = record->data[index_data++];
|
}
|
||||||
amc_record->ch_count = record->data[index_data++];
|
amc_record->rsc_id = record->data[index_data++];
|
||||||
/*Calculate link descriptor count*/
|
amc_record->ch_count = record->data[index_data++];
|
||||||
amc_record->link_desc_count = ( (record->header.len) - 8 -
|
/* Calculate link descriptor count */
|
||||||
(SIZE_OF_GUID*amc_record->guid_count) -
|
amc_record->link_desc_count = ((record->header.len) - 8 -
|
||||||
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
(SIZE_OF_GUID*amc_record->guid_count) -
|
||||||
amc_record->ch_count)
|
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
||||||
)/5 ;
|
amc_record->ch_count)) / 5 ;
|
||||||
}
|
} else {
|
||||||
else{
|
amc_record->rsc_id = record->data[index_data++];
|
||||||
amc_record->rsc_id = record->data[index_data++];
|
amc_record->ch_count = record->data[index_data++];
|
||||||
amc_record->ch_count = record->data[index_data++];
|
/* Calculate link descriptor count see spec AMC.0 for detail */
|
||||||
/*Calculate link descriptor count see spec AMC.0 for detail*/
|
amc_record->link_desc_count = ((record->header.len) - 8 -
|
||||||
amc_record->link_desc_count = ( (record->header.len) - 8 -
|
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
||||||
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
amc_record->ch_count)) / 5;
|
||||||
amc_record->ch_count )
|
}
|
||||||
) / 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (amc_record->ch_count > 0){
|
if (amc_record->ch_count > 0) {
|
||||||
int ch_index = 0;
|
int ch_index = 0;
|
||||||
amc_record->ch_desc = malloc ( (amc_record->ch_count) * \
|
amc_record->ch_desc = malloc((amc_record->ch_count) * \
|
||||||
sizeof(struct fru_picmgext_amc_channel_desc_record));
|
sizeof(struct fru_picmgext_amc_channel_desc_record));
|
||||||
for (ch_index = 0; ch_index < amc_record->ch_count; ch_index++){
|
for (ch_index = 0; ch_index < amc_record->ch_count;
|
||||||
unsigned int data;
|
ch_index++) {
|
||||||
struct fru_picmgext_amc_channel_desc_record *src, *dst;
|
unsigned int data;
|
||||||
data = record->data[index_data] |
|
struct fru_picmgext_amc_channel_desc_record *src, *dst;
|
||||||
(record->data[index_data + 1] << 8) |
|
data = record->data[index_data] |
|
||||||
(record->data[index_data + 2] << 16);
|
(record->data[index_data + 1] << 8) |
|
||||||
|
(record->data[index_data + 2] << 16);
|
||||||
|
|
||||||
|
src = (struct fru_picmgext_amc_channel_desc_record *)&data;
|
||||||
|
dst = (struct fru_picmgext_amc_channel_desc_record *)
|
||||||
|
&amc_record->ch_desc[ch_index];
|
||||||
|
|
||||||
src = (struct fru_picmgext_amc_channel_desc_record *) &data;
|
dst->lane0port = src->lane0port;
|
||||||
dst = (struct fru_picmgext_amc_channel_desc_record *)
|
dst->lane1port = src->lane1port;
|
||||||
&amc_record->ch_desc[ch_index];
|
dst->lane2port = src->lane2port;
|
||||||
dst->lane0port = src->lane0port;
|
dst->lane3port = src->lane3port;
|
||||||
dst->lane1port = src->lane1port;
|
index_data += FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE;
|
||||||
dst->lane2port = src->lane2port;
|
}
|
||||||
dst->lane3port = src->lane3port;
|
}
|
||||||
index_data += FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE;
|
if (amc_record->link_desc_count > 0) {
|
||||||
}
|
int i=0;
|
||||||
}
|
amc_record->link_desc = malloc(amc_record->link_desc_count * \
|
||||||
if (amc_record->link_desc_count > 0){
|
sizeof(struct fru_picmgext_amc_link_desc_record));
|
||||||
int i=0;
|
for (i = 0; i< amc_record->link_desc_count; i++) {
|
||||||
amc_record->link_desc = malloc ( amc_record->link_desc_count *
|
unsigned int data[2];
|
||||||
sizeof(struct fru_picmgext_amc_link_desc_record) );
|
struct fru_picmgext_amc_link_desc_record *src, *dst;
|
||||||
for (i = 0; i< amc_record->link_desc_count; i++ ){
|
data[0] = record->data[index_data] |
|
||||||
unsigned int data[2];
|
(record->data[index_data + 1] << 8) |
|
||||||
struct fru_picmgext_amc_link_desc_record *src, *dst;
|
(record->data[index_data + 2] << 16) |
|
||||||
data[0] = record->data[index_data] |
|
(record->data[index_data + 3] << 24);
|
||||||
(record->data[index_data + 1] << 8) |
|
|
||||||
(record->data[index_data + 2] << 16) |
|
|
||||||
(record->data[index_data + 3] << 24);
|
|
||||||
data[1] = record->data[index_data + 4];
|
|
||||||
src = (struct fru_picmgext_amc_link_desc_record*) &data;
|
|
||||||
dst = (struct fru_picmgext_amc_link_desc_record*)
|
|
||||||
&amc_record->link_desc[i];
|
|
||||||
|
|
||||||
dst->channel_id = src->channel_id;
|
data[1] = record->data[index_data + 4];
|
||||||
dst->port_flag_0 = src->port_flag_0;
|
src = (struct fru_picmgext_amc_link_desc_record*)&data;
|
||||||
dst->port_flag_1 = src->port_flag_1;
|
dst = (struct fru_picmgext_amc_link_desc_record*)
|
||||||
dst->port_flag_2 = src->port_flag_2;
|
&amc_record->link_desc[i];
|
||||||
dst->port_flag_3 = src->port_flag_3;
|
|
||||||
dst->type = src->type;
|
|
||||||
dst->type_ext = src->type_ext;
|
|
||||||
dst->group_id = src->group_id;
|
|
||||||
dst->asym_match = src->asym_match;
|
|
||||||
index_data += FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return_status = ERROR_STATUS;
|
|
||||||
}
|
|
||||||
|
|
||||||
return return_status;
|
dst->channel_id = src->channel_id;
|
||||||
|
dst->port_flag_0 = src->port_flag_0;
|
||||||
|
dst->port_flag_1 = src->port_flag_1;
|
||||||
|
dst->port_flag_2 = src->port_flag_2;
|
||||||
|
dst->port_flag_3 = src->port_flag_3;
|
||||||
|
dst->type = src->type;
|
||||||
|
dst->type_ext = src->type_ext;
|
||||||
|
dst->group_id = src->group_id;
|
||||||
|
dst->asym_match = src->asym_match;
|
||||||
|
index_data += FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return_status = ERROR_STATUS;
|
||||||
|
}
|
||||||
|
return return_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user