ID:454 - Add support for PICMG 3.1 R2.0 Link Types and Link Classes.

PICMG 3.1 R2.0 introduces new a new Link Class field in the FRU
Link Descriptors which is the upper 4 bits of the Link Type field.
This new Link Class field specifies SERDES lanes with 10.3125Gbd
signalling rate.

It also introduces the new Base-KX and Base-KX4 types which are the
new IEEE replacements for the PICMG 3.0 Base-BX and Base-BX4 types.

This patch decodes these new types and fields and will print out
proper descriptions for each one based on PICMG 3.1 R2.0
This commit is contained in:
Dan Gora 2016-07-28 18:00:22 -03:00 committed by Zdenek Styblik
parent e30c357db7
commit ea471ed5fa
2 changed files with 68 additions and 50 deletions

View File

@ -297,22 +297,24 @@ struct fru_picmgext_link_desc {
unsigned int desig_channel:6; unsigned int desig_channel:6;
unsigned int desig_if:2; unsigned int desig_if:2;
unsigned int desig_port:4; unsigned int desig_port:4;
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 #define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 #define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8; unsigned int type:8;
unsigned int ext:4; unsigned int ext:4;
unsigned int grouping:8; unsigned int grouping:8;
#else #else
unsigned int grouping:8; unsigned int grouping:8;
unsigned int ext:4; unsigned int ext:4;
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 #define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 #define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8; unsigned int type:8;
unsigned int desig_port:4; unsigned int desig_port:4;
unsigned int desig_if:2; unsigned int desig_if:2;

View File

@ -2288,8 +2288,7 @@ static void ipmi_fru_picmg_ext_print(uint8_t * fru_data, int off, int length)
printf(" Link Type Extension: 0x%02x - ", printf(" Link Type Extension: 0x%02x - ",
d->ext); d->ext);
if (d->type == FRU_PICMGEXT_LINK_TYPE_BASE) { if (d->type == FRU_PICMGEXT_LINK_TYPE_BASE) {
switch (d->ext) switch (d->ext) {
{
case 0: case 0:
printf("10/100/1000BASE-T Link (four-pair)\n"); printf("10/100/1000BASE-T Link (four-pair)\n");
break; break;
@ -2297,76 +2296,93 @@ static void ipmi_fru_picmg_ext_print(uint8_t * fru_data, int off, int length)
printf("ShMC Cross-connect (two-pair)\n"); printf("ShMC Cross-connect (two-pair)\n");
break; break;
default: default:
printf("Unknwon\n"); printf("Unknown\n");
break; break;
} }
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET) { } else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET) {
switch (d->ext) switch (d->ext) {
{
case 0: case 0:
printf("Fixed 1000Base-BX\n"); printf("1000Base-BX\n");
break; break;
case 1: case 1:
printf("Fixed 10GBASE-BX4 [XAUI]\n"); printf("10GBase-BX4 [XAUI]\n");
break; break;
case 2: case 2:
printf("FC-PI\n"); printf("FC-PI\n");
break; break;
case 3:
printf("1000Base-KX\n");
break;
case 4:
printf("10GBase-KX4\n");
break;
default: default:
printf("Unknwon\n"); printf("Unknown\n");
break;
}
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD) {
switch (d->ext) {
case 0:
printf("10GBase-KR\n");
break;
case 1:
printf("40GBase-KR4\n");
break;
default:
printf("Unknown\n");
break; break;
} }
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND) { } else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND) {
printf("Unknwon\n"); printf("Unknown\n");
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR) { } else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR) {
printf("Unknwon\n"); printf("Unknown\n");
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_PCIE) { } else if (d->type == FRU_PICMGEXT_LINK_TYPE_PCIE) {
printf("Unknwon\n"); printf("Unknown\n");
} else { } else {
printf("Unknwon\n"); printf("Unknown\n");
} }
printf(" Link Type: 0x%02x - ", printf(" Link Type: 0x%02x - ",
d->type); d->type);
if (d->type == 0 || d->type == 0xff) { switch (d->type) {
printf("Reserved\n"); case FRU_PICMGEXT_LINK_TYPE_BASE:
} printf("PICMG 3.0 Base Interface 10/100/1000\n");
else if (d->type >= 0x06 && d->type <= 0xef) { break;
printf("Reserved\n"); case FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET:
} printf("PICMG 3.1 Ethernet Fabric Interface\n");
else if (d->type >= 0xf0 && d->type <= 0xfe) { printf(" Base signaling Link Class\n");
printf("OEM GUID Definition\n"); break;
} case FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND:
else { printf("PICMG 3.2 Infiniband Fabric Interface\n");
switch (d->type) break;
{ case FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR:
case FRU_PICMGEXT_LINK_TYPE_BASE: printf("PICMG 3.3 Star Fabric Interface\n");
printf("PICMG 3.0 Base Interface 10/100/1000\n"); break;
break; case FRU_PICMGEXT_LINK_TYPE_PCIE:
case FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET: printf("PICMG 3.4 PCI Express Fabric Interface\n");
printf("PICMG 3.1 Ethernet Fabric Interface\n"); break;
break; case FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD:
case FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND: printf("PICMG 3.1 Ethernet Fabric Interface\n");
printf("PICMG 3.2 Infiniband Fabric Interface\n"); printf(" 10.3125Gbd signaling Link Class\n");
break; break;
case FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR: default:
printf("PICMG 3.3 Star Fabric Interface\n"); if (d->type == 0 || d->type == 0xff) {
break; printf("Reserved\n");
case FRU_PICMGEXT_LINK_TYPE_PCIE: } else if (d->type >= 0x06 && d->type <= 0xef) {
printf("PICMG 3.4 PCI Express Fabric Interface\n"); printf("Reserved\n");
break; } else if (d->type >= 0xf0 && d->type <= 0xfe) {
default: printf("OEM GUID Definition\n");
} else {
printf("Invalid\n"); printf("Invalid\n");
break; }
} break;
} }
printf(" Link Designator: \n"); printf(" Link Designator: \n");
printf(" Port Flag: 0x%02x\n", printf(" Port Flag: 0x%02x\n",
d->desig_port); d->desig_port);
printf(" Interface: 0x%02x - ", printf(" Interface: 0x%02x - ",
d->desig_if); d->desig_if);
switch (d->desig_if) switch (d->desig_if) {
{
case FRU_PICMGEXT_DESIGN_IF_BASE: case FRU_PICMGEXT_DESIGN_IF_BASE:
printf("Base Interface\n"); printf("Base Interface\n");
break; break;