1313 * Copyright 2020, The University of Queensland
1414 * Copyright (c) 2018, Joyent, Inc.
1515 * Copyright 2020 RackTop Systems, Inc.
16+ * Copyright 2023 MNX Cloud, Inc.
1617 */
1718
1819/*
@@ -416,7 +417,8 @@ mlxcx_port_status_string(mlxcx_port_status_t st)
416417}
417418
418419void
419- mlxcx_eth_proto_to_string (mlxcx_eth_proto_t p , char * buf , size_t size )
420+ mlxcx_eth_proto_to_string (mlxcx_eth_proto_t p , mlxcx_ext_eth_proto_t ep ,
421+ char * buf , size_t size )
420422{
421423 if (p & MLXCX_PROTO_SGMII )
422424 (void ) strlcat (buf , "SGMII|" , size );
@@ -446,12 +448,22 @@ mlxcx_eth_proto_to_string(mlxcx_eth_proto_t p, char *buf, size_t size)
446448 (void ) strlcat (buf , "40GBASE_LR4_ER4|" , size );
447449 if (p & MLXCX_PROTO_50GBASE_SR2 )
448450 (void ) strlcat (buf , "50GBASE_SR2|" , size );
451+ if (p & MLXCX_PROTO_50GBASE_KR4 )
452+ (void ) strlcat (buf , "50GBASE_KR4|" , size );
449453 if (p & MLXCX_PROTO_100GBASE_CR4 )
450454 (void ) strlcat (buf , "100GBASE_CR4|" , size );
451455 if (p & MLXCX_PROTO_100GBASE_SR4 )
452456 (void ) strlcat (buf , "100GBASE_SR4|" , size );
453457 if (p & MLXCX_PROTO_100GBASE_KR4 )
454458 (void ) strlcat (buf , "100GBASE_KR4|" , size );
459+ if (p & MLXCX_PROTO_100GBASE_LR4 )
460+ (void ) strlcat (buf , "100GBASE_LR4|" , size );
461+ if (p & MLXCX_PROTO_100BASE_T )
462+ (void ) strlcat (buf , "100BASE_T|" , size );
463+ if (p & MLXCX_PROTO_1000BASE_T )
464+ (void ) strlcat (buf , "1000BASE_T|" , size );
465+ if (p & MLXCX_PROTO_10GBASE_T )
466+ (void ) strlcat (buf , "10GBASE_T|" , size );
455467 if (p & MLXCX_PROTO_25GBASE_CR )
456468 (void ) strlcat (buf , "25GBASE_CR|" , size );
457469 if (p & MLXCX_PROTO_25GBASE_KR )
@@ -460,6 +472,40 @@ mlxcx_eth_proto_to_string(mlxcx_eth_proto_t p, char *buf, size_t size)
460472 (void ) strlcat (buf , "25GBASE_SR|" , size );
461473 if (p & MLXCX_PROTO_50GBASE_CR2 )
462474 (void ) strlcat (buf , "50GBASE_CR2|" , size );
475+
476+ /* Now, for the extended bits... */
477+ if (ep & MLXCX_EXTPROTO_SGMII_100M )
478+ (void ) strlcat (buf , "SGMII_100M|" , size );
479+ if (ep & MLXCX_EXTPROTO_1000BASE_X_SGMII )
480+ (void ) strlcat (buf , "1000BASE_X_SGMII|" , size );
481+ if (ep & MLXCX_EXTPROTO_5GBASE_R )
482+ (void ) strlcat (buf , "5GBASE_R|" , size );
483+ if (ep & MLXCX_EXTPROTO_10GBASE_XFI_XAUI_1 )
484+ (void ) strlcat (buf , "10GBASE_XFI_XAUI_1|" , size );
485+ if (ep & MLXCX_EXTPROTO_40GBASE_XLAUI_4_XLPPI_4 )
486+ (void ) strlcat (buf , "40GBASE_XLAUI_4_XLPPI_4|" , size );
487+ if (ep & MLXCX_EXTPROTO_25GAUI_1_25GBASE_CR_KR )
488+ (void ) strlcat (buf , "25GAUI_1_25GBASE_CR_KR|" , size );
489+ if (ep & MLXCX_EXTPROTO_50GAUI_2_LAUI_2_50GBASE_CR2_KR2 )
490+ (void ) strlcat (buf , "50GAUI_2_LAUI_2_50GBASE_CR2_KR2|" , size );
491+ if (ep & MLXCX_EXTPROTO_50GAUI_1_LAUI_1_50GBASE_CR_KR )
492+ (void ) strlcat (buf , "50GAUI_1_LAUI_1_50GBASE_CR_KR|" , size );
493+ if (ep & MLXCX_EXTPROTO_CAUI_4_100GBASE_CR4_KR4 )
494+ (void ) strlcat (buf , "CAUI_4_100GBASE_CR4_KR4|" , size );
495+ if (ep & MLXCX_EXTPROTO_100GAUI_2_100GBASE_CR2_KR2 )
496+ (void ) strlcat (buf , "100GAUI_2_100GBASE_CR2_KR2|" , size );
497+ if (ep & MLXCX_EXTPROTO_100GAUI_1_100GBASE_CR_KR )
498+ (void ) strlcat (buf , "100GAUI_1_100GBASE_CR_KR|" , size );
499+ /* Print these if we need 'em for debugging... */
500+ if (ep & MLXCX_EXTPROTO_200GAUI_4_200GBASE_CR4_KR4 )
501+ (void ) strlcat (buf , "200GAUI_4_200GBASE_CR4_KR4|" , size );
502+ if (ep & MLXCX_EXTPROTO_200GAUI_2_200GBASE_CR2_KR2 )
503+ (void ) strlcat (buf , "200GAUI_2_200GBASE_CR2_KR2|" , size );
504+ if (ep & MLXCX_EXTPROTO_400GAUI_8 )
505+ (void ) strlcat (buf , "400GAUI_8|" , size );
506+ if (ep & MLXCX_EXTPROTO_400GAUI_4_400GBASE_CR4_KR4 )
507+ (void ) strlcat (buf , "400GAUI_4_400GBASE_CR4_KR4|" , size );
508+
463509 /* Chop off the trailing '|' */
464510 if (strlen (buf ) > 0 )
465511 buf [strlen (buf ) - 1 ] = '\0' ;
@@ -1929,6 +1975,12 @@ mlxcx_cmd_query_port_speed(mlxcx_t *mlxp, mlxcx_port_t *mlp)
19291975 from_bits32 (data .mlrd_ptys .mlrd_ptys_proto_admin );
19301976 mlp -> mlp_oper_proto =
19311977 from_bits32 (data .mlrd_ptys .mlrd_ptys_proto_oper );
1978+ mlp -> mlp_ext_max_proto =
1979+ from_bits32 (data .mlrd_ptys .mlrd_ptys_ext_proto_cap );
1980+ mlp -> mlp_ext_admin_proto =
1981+ from_bits32 (data .mlrd_ptys .mlrd_ptys_ext_proto_admin );
1982+ mlp -> mlp_ext_oper_proto =
1983+ from_bits32 (data .mlrd_ptys .mlrd_ptys_ext_proto_oper );
19321984 }
19331985
19341986 return (ret );
@@ -3717,7 +3769,9 @@ CTASSERT(offsetof(mlxcx_cmd_create_rqt_in_t, mlxi_create_rqt_context) == 0x20);
37173769CTASSERT (offsetof(mlxcx_reg_pmtu_t , mlrd_pmtu_oper_mtu ) == 0x0C );
37183770
37193771CTASSERT (sizeof (mlxcx_reg_ptys_t ) == 64 );
3772+ CTASSERT (offsetof(mlxcx_reg_ptys_t , mlrd_ptys_ext_proto_cap ) == 0x08 );
37203773CTASSERT (offsetof(mlxcx_reg_ptys_t , mlrd_ptys_proto_cap ) == 0x0c );
3774+ CTASSERT (offsetof(mlxcx_reg_ptys_t , mlrd_ptys_ext_proto_admin ) == 0x14 );
37213775CTASSERT (offsetof(mlxcx_reg_ptys_t , mlrd_ptys_proto_admin ) == 0x18 );
37223776CTASSERT (offsetof(mlxcx_reg_ptys_t , mlrd_ptys_proto_partner_advert ) == 0x30 );
37233777
0 commit comments