Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muskaan 1g bx2 #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules/sff/module/auto/sff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ sff_module_types: &sff_module_types
desc: "100G-AOC-LBER"
- 100G_ACC_LBER:
desc: "100G-ACC-LBER"
- 100G_BASE_DR:
desc: "100GBASE-DR"
- 100G_BASE_FR:
desc: "100GBASE-FR"
- 100G_BASE_LR:
desc: "100GBASE-LR"
- 40G_BASE_CR4:
desc: "40GBASE-CR4"
- 40G_BASE_SR4:
Expand Down Expand Up @@ -138,6 +144,10 @@ sff_module_types: &sff_module_types
desc: "1GBASE-SX"
- 1G_BASE_LX:
desc: "1GBASE-LX"
- 1G_BASE_BX10:
desc: "1GBASE-BX-10"
- 1G_BASE_BX40:
desc: "1GBASE-BX-40"
- 1G_BASE_ZX:
desc: "1GBASE-ZX"
- 1G_BASE_CX:
Expand Down
7 changes: 7 additions & 0 deletions modules/sff/module/inc/sff/8472.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
#define SFF8472_CC6_CBE_BASE_LX 0x10
#define SFF8472_CC6_CBE_BASE_FX 0x20
#define SFF8472_CC6_BASE_BX10 0x40
#define SFF8472_CC6_BASE_BX40 0x40
#define SFF8472_CC6_BASE_PX 0x80

#define SFF8472_CC7_FC_TECH_EL 0x01
Expand Down Expand Up @@ -566,6 +567,10 @@ _sff8472_hack_cr(const uint8_t* idprom)

#define SFF8472_MEDIA_CBE_LX(idprom) \
((idprom[6] & SFF8472_CC6_CBE_BASE_LX) != 0)
#define SSFF8472_MEDIA_CC6_BX10(idprom) \
((idprom[6] & SFF8472_CC6_BASE_BX10) != 0)
#define SSFF8472_MEDIA_CC6_BX40(idprom) \
((idprom[6] & SFF8472_CC6_BASE_BX40) != 0)
#define SFF8472_MEDIA_CBE_FX(idprom) \
((idprom[6] & SFF8472_CC6_CBE_BASE_FX) != 0)

Expand Down Expand Up @@ -918,6 +923,8 @@ _sff8472_sfp_10g_aoc(const uint8_t *idprom)
if (SFF8472_MEDIA_GBE_CX(idprom)) return 0;
if (SFF8472_MEDIA_GBE_T(idprom)) return 0;
if (SFF8472_MEDIA_CBE_LX(idprom)) return 0;
if (SSFF8472_MEDIA_CC6_BX10(idprom)) return 0;
if (SSFF8472_MEDIA_CC6_BX40(idprom)) return 0;
if (SFF8472_MEDIA_CBE_FX(idprom)) return 0;

/* should be active */
Expand Down
9 changes: 9 additions & 0 deletions modules/sff/module/inc/sff/8636.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
#define SFF8636_CC192_40GE_SWDM4 0x1F
#define SFF8636_CC192_100GE_SWDM4 0x20
#define SFF8636_CC192_100GE_PAM4_BIDI 0x21
#define SFF8636_CC192_100GE_DR 0x25
#define SFF8636_CC192_100GE_FR 0x26
#define SFF8636_CC192_100GE_LR 0x27

#define SFF8636_MEDIA_100GE_AOC(idprom) \
((idprom[192] == SFF8636_CC192_100GE_AOC) || \
Expand Down Expand Up @@ -176,6 +179,12 @@
(idprom[192] == SFF8636_CC192_100GE_AOC_LBER)
#define SFF8636_MEDIA_100GE_ACC_LBER(idprom) \
(idprom[192] == SFF8636_CC192_100GE_ACC_LBER)
#define SFF8636_MEDIA_100GE_DR(idprom) \
(idprom[192] == SFF8636_CC192_100GE_DR)
#define SFF8636_MEDIA_100GE_FR(idprom) \
(idprom[192] == SFF8636_CC192_100GE_FR)
#define SFF8636_MEDIA_100GE_LR(idprom) \
(idprom[192] == SFF8636_CC192_100GE_LR)
#define SFF8636_MEDIA_40GE_ER4(idprom) \
(idprom[192] == SFF8636_CC192_40GE_ER4)
#define SFF8636_MEDIA_40GE_SWDM4(idprom) \
Expand Down
10 changes: 10 additions & 0 deletions modules/sff/module/inc/sff/sff.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ typedef enum sff_module_type_e {
SFF_MODULE_TYPE_100G_PAM4_BIDI,
SFF_MODULE_TYPE_100G_AOC_LBER,
SFF_MODULE_TYPE_100G_ACC_LBER,
SFF_MODULE_TYPE_100G_BASE_DR,
SFF_MODULE_TYPE_100G_BASE_FR,
SFF_MODULE_TYPE_100G_BASE_LR,
SFF_MODULE_TYPE_40G_BASE_CR4,
SFF_MODULE_TYPE_40G_BASE_SR4,
SFF_MODULE_TYPE_40G_BASE_LR4,
Expand Down Expand Up @@ -150,6 +153,8 @@ typedef enum sff_module_type_e {
SFF_MODULE_TYPE_1G_BASE_T,
SFF_MODULE_TYPE_100_BASE_LX,
SFF_MODULE_TYPE_100_BASE_FX,
SFF_MODULE_TYPE_1G_BASE_BX10,
SFF_MODULE_TYPE_1G_BASE_BX40,
SFF_MODULE_TYPE_4X_MUX,
SFF_MODULE_TYPE_LAST = SFF_MODULE_TYPE_4X_MUX,
SFF_MODULE_TYPE_COUNT,
Expand Down Expand Up @@ -180,6 +185,9 @@ typedef enum sff_module_type_e {
"100G_PAM4_BIDI", \
"100G_AOC_LBER", \
"100G_ACC_LBER", \
"100G_BASE_DR", \
"100G_BASE_FR", \
"100G_BASE_LR", \
"40G_BASE_CR4", \
"40G_BASE_SR4", \
"40G_BASE_LR4", \
Expand All @@ -206,6 +214,8 @@ typedef enum sff_module_type_e {
"10G_BASE_T", \
"1G_BASE_SX", \
"1G_BASE_LX", \
"1G_BASE_BX10",\
"1G_BASE_BX40",\
"1G_BASE_ZX", \
"1G_BASE_CX", \
"1G_BASE_T", \
Expand Down
6 changes: 6 additions & 0 deletions modules/sff/module/inc/sff/sff.x
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ SFF_MEDIA_TYPE_ENTRY(100G_SWDM4, 100G-SWDM4)
SFF_MEDIA_TYPE_ENTRY(100G_PAM4_BIDI, 100G-PAM4-BIDI)
SFF_MEDIA_TYPE_ENTRY(100G_AOC_LBER, 100G-AOC-LBER)
SFF_MEDIA_TYPE_ENTRY(100G_ACC_LBER, 100G-ACC-LBER)
SFF_MEDIA_TYPE_ENTRY(100G_BASE_DR, 100GBASE-DR)
SFF_MEDIA_TYPE_ENTRY(100G_BASE_FR, 100GBASE-FR)
SFF_MEDIA_TYPE_ENTRY(100G_BASE_LR, 100GBASE-LR)
SFF_MEDIA_TYPE_ENTRY(40G_BASE_CR4, 40GBASE-CR4)
SFF_MEDIA_TYPE_ENTRY(40G_BASE_SR4, 40GBASE-SR4)
SFF_MEDIA_TYPE_ENTRY(40G_BASE_LR4, 40GBASE-LR4)
Expand Down Expand Up @@ -96,6 +99,9 @@ SFF_MODULE_TYPE_ENTRY(100G_SWDM4, 100G-SWDM4)
SFF_MODULE_TYPE_ENTRY(100G_PAM4_BIDI, 100G-PAM4-BIDI)
SFF_MODULE_TYPE_ENTRY(100G_AOC_LBER, 100G-AOC-LBER)
SFF_MODULE_TYPE_ENTRY(100G_ACC_LBER, 100G-ACC-LBER)
SFF_MODULE_TYPE_ENTRY(100G_BASE_DR, 100GBASE-DR)
SFF_MODULE_TYPE_ENTRY(100G_BASE_FR, 100GBASE-FR)
SFF_MODULE_TYPE_ENTRY(100G_BASE_LR, 100GBASE-LR)
SFF_MODULE_TYPE_ENTRY(40G_BASE_CR4, 40GBASE-CR4)
SFF_MODULE_TYPE_ENTRY(40G_BASE_SR4, 40GBASE-SR4)
SFF_MODULE_TYPE_ENTRY(40G_BASE_LR4, 40GBASE-LR4)
Expand Down
42 changes: 40 additions & 2 deletions modules/sff/module/src/sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ sff_module_type_get(const uint8_t* eeprom)
&& SFF8636_MEDIA_100GE_LR4(eeprom))
return SFF_MODULE_TYPE_100G_BASE_LR4;

if (SFF8636_MODULE_QSFP28(eeprom)
&& SFF8636_MEDIA_EXTENDED(eeprom)
&& SFF8636_MEDIA_100GE_DR(eeprom))
return SFF_MODULE_TYPE_100G_BASE_DR;

if (SFF8636_MODULE_QSFP28(eeprom)
&& SFF8636_MEDIA_EXTENDED(eeprom)
&& SFF8636_MEDIA_100GE_FR(eeprom))
return SFF_MODULE_TYPE_100G_BASE_FR;

if (SFF8636_MODULE_QSFP28(eeprom)
&& SFF8636_MEDIA_EXTENDED(eeprom)
&& SFF8636_MEDIA_100GE_LR(eeprom))
return SFF_MODULE_TYPE_100G_BASE_LR;

if (SFF8636_MODULE_QSFP28(eeprom)
&& SFF8636_MEDIA_EXTENDED(eeprom)
&& (SFF8636_MEDIA_100GE_CR4(eeprom) ||
Expand Down Expand Up @@ -285,6 +300,14 @@ sff_module_type_get(const uint8_t* eeprom)
&& SFF8472_MEDIA_CBE_FX(eeprom))
return SFF_MODULE_TYPE_100_BASE_FX;

if (SFF8472_MODULE_SFP(eeprom)
&& SSFF8472_MEDIA_CC6_BX10(eeprom))
return SFF_MODULE_TYPE_1G_BASE_BX10;

if (SFF8472_MODULE_SFP(eeprom)
&& SSFF8472_MEDIA_CC6_BX40(eeprom))
return SFF_MODULE_TYPE_1G_BASE_BX40;

/* non-standard (e.g. Finisar) ZR media */
if (SFF8472_MODULE_SFP(eeprom)
&& _sff8472_media_zr(eeprom))
Expand Down Expand Up @@ -333,6 +356,9 @@ sff_media_type_get(sff_module_type_t mt)
case SFF_MODULE_TYPE_100G_SWDM4:
case SFF_MODULE_TYPE_100G_PAM4_BIDI:
case SFF_MODULE_TYPE_100G_AOC_LBER:
case SFF_MODULE_TYPE_100G_BASE_DR:
case SFF_MODULE_TYPE_100G_BASE_FR:
case SFF_MODULE_TYPE_100G_BASE_LR:
case SFF_MODULE_TYPE_40G_BASE_SR4:
case SFF_MODULE_TYPE_40G_BASE_LR4:
case SFF_MODULE_TYPE_40G_BASE_LM4:
Expand All @@ -357,7 +383,9 @@ sff_media_type_get(sff_module_type_t mt)
case SFF_MODULE_TYPE_1G_BASE_ZX:
case SFF_MODULE_TYPE_100_BASE_LX:
case SFF_MODULE_TYPE_100_BASE_FX:
case SFF_MODULE_TYPE_4X_MUX:
case SFF_MODULE_TYPE_1G_BASE_BX10:
case SFF_MODULE_TYPE_1G_BASE_BX40:
case SFF_MODULE_TYPE_4X_MUX:
return SFF_MEDIA_TYPE_FIBER;

case SFF_MODULE_TYPE_COUNT:
Expand Down Expand Up @@ -389,6 +417,9 @@ sff_module_caps_get(sff_module_type_t mt, uint32_t *caps)
case SFF_MODULE_TYPE_100G_PAM4_BIDI:
case SFF_MODULE_TYPE_100G_AOC_LBER:
case SFF_MODULE_TYPE_100G_ACC_LBER:
case SFF_MODULE_TYPE_100G_BASE_DR:
case SFF_MODULE_TYPE_100G_BASE_FR:
case SFF_MODULE_TYPE_100G_BASE_LR:
*caps |= SFF_MODULE_CAPS_F_100G;
return 0;

Expand Down Expand Up @@ -428,7 +459,9 @@ sff_module_caps_get(sff_module_type_t mt, uint32_t *caps)
case SFF_MODULE_TYPE_1G_BASE_LX:
case SFF_MODULE_TYPE_1G_BASE_ZX:
case SFF_MODULE_TYPE_1G_BASE_CX:
case SFF_MODULE_TYPE_1G_BASE_T:
case SFF_MODULE_TYPE_1G_BASE_BX10:
case SFF_MODULE_TYPE_1G_BASE_BX40:
case SFF_MODULE_TYPE_1G_BASE_T:
*caps |= SFF_MODULE_CAPS_F_1G;
return 0;

Expand Down Expand Up @@ -847,6 +880,9 @@ sff_info_init(sff_info_t* info, sff_module_type_t mt,
case SFF_MODULE_TYPE_100G_SWDM4:
case SFF_MODULE_TYPE_100G_PAM4_BIDI:
case SFF_MODULE_TYPE_100G_AOC_LBER:
case SFF_MODULE_TYPE_100G_BASE_DR:
case SFF_MODULE_TYPE_100G_BASE_FR:
case SFF_MODULE_TYPE_100G_BASE_LR:
info->sfp_type = SFF_SFP_TYPE_QSFP28;
info->media_type = SFF_MEDIA_TYPE_FIBER;
info->caps = SFF_MODULE_CAPS_F_100G;
Expand Down Expand Up @@ -916,6 +952,8 @@ sff_info_init(sff_info_t* info, sff_module_type_t mt,

case SFF_MODULE_TYPE_1G_BASE_SX:
case SFF_MODULE_TYPE_1G_BASE_LX:
case SFF_MODULE_TYPE_1G_BASE_BX10:
case SFF_MODULE_TYPE_1G_BASE_BX40:
case SFF_MODULE_TYPE_1G_BASE_ZX:
info->sfp_type = SFF_SFP_TYPE_SFP;
info->media_type = SFF_MEDIA_TYPE_FIBER;
Expand Down
5 changes: 5 additions & 0 deletions modules/sff/module/src/sff_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
#define SFF_1G_BASE_SX_PROPERTIES \
SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_1G_BASE_SX, "1GBASE-SX", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_1G

#define SFF_1G_BASE_BX10_PROPERTIES \
SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_1G_BASE_BX10, "1GBASE-BX-10", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_1G

#define SFF_1G_BASE_BX40_PROPERTIES \
SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_1G_BASE_BX40, "1GBASE-BX-40", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_1G

#define SFF_1G_BASE_LX_PROPERTIES \
SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_1G_BASE_LX, "1GBASE-LR", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_1G
Expand Down
10 changes: 10 additions & 0 deletions modules/sff/module/src/sff_enums.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,9 @@ aim_map_si_t sff_module_type_map[] =
{ "100G_PAM4_BIDI", SFF_MODULE_TYPE_100G_PAM4_BIDI },
{ "100G_AOC_LBER", SFF_MODULE_TYPE_100G_AOC_LBER },
{ "100G_ACC_LBER", SFF_MODULE_TYPE_100G_ACC_LBER },
{ "100G_BASE_DR", SFF_MODULE_TYPE_100G_BASE_DR },
{ "100G_BASE_FR", SFF_MODULE_TYPE_100G_BASE_FR },
{ "100G_BASE_LR", SFF_MODULE_TYPE_100G_BASE_LR },
{ "40G_BASE_CR4", SFF_MODULE_TYPE_40G_BASE_CR4 },
{ "40G_BASE_SR4", SFF_MODULE_TYPE_40G_BASE_SR4 },
{ "40G_BASE_LR4", SFF_MODULE_TYPE_40G_BASE_LR4 },
Expand All @@ -842,6 +845,8 @@ aim_map_si_t sff_module_type_map[] =
{ "10G_BASE_T", SFF_MODULE_TYPE_10G_BASE_T },
{ "1G_BASE_SX", SFF_MODULE_TYPE_1G_BASE_SX },
{ "1G_BASE_LX", SFF_MODULE_TYPE_1G_BASE_LX },
{ "1G_BASE_BX10", SFF_MODULE_TYPE_1G_BASE_BX10 },
{ "1G_BASE_BX40", SFF_MODULE_TYPE_1G_BASE_BX40 },
{ "1G_BASE_ZX", SFF_MODULE_TYPE_1G_BASE_ZX },
{ "1G_BASE_CX", SFF_MODULE_TYPE_1G_BASE_CX },
{ "1G_BASE_T", SFF_MODULE_TYPE_1G_BASE_T },
Expand Down Expand Up @@ -874,6 +879,9 @@ aim_map_si_t sff_module_type_desc_map[] =
{ "100G-PAM4-BIDI", SFF_MODULE_TYPE_100G_PAM4_BIDI },
{ "100G-AOC-LBER", SFF_MODULE_TYPE_100G_AOC_LBER },
{ "100G-ACC-LBER", SFF_MODULE_TYPE_100G_ACC_LBER },
{ "100GBASE-DR", SFF_MODULE_TYPE_100G_BASE_DR},
{ "100GBASE-FR", SFF_MODULE_TYPE_100G_BASE_FR},
{ "100GBASE-LR", SFF_MODULE_TYPE_100G_BASE_LR},
{ "40GBASE-CR4", SFF_MODULE_TYPE_40G_BASE_CR4 },
{ "40GBASE-SR4", SFF_MODULE_TYPE_40G_BASE_SR4 },
{ "40GBASE-LR4", SFF_MODULE_TYPE_40G_BASE_LR4 },
Expand All @@ -900,6 +908,8 @@ aim_map_si_t sff_module_type_desc_map[] =
{ "10GBASE-T", SFF_MODULE_TYPE_10G_BASE_T },
{ "1GBASE-SX", SFF_MODULE_TYPE_1G_BASE_SX },
{ "1GBASE-LX", SFF_MODULE_TYPE_1G_BASE_LX },
{ "1GBASE-BX-10", SFF_MODULE_TYPE_1G_BASE_BX10 },
{ "1G_BASE_BX40", SFF_MODULE_TYPE_1G_BASE_BX40 },
{ "1GBASE-ZX", SFF_MODULE_TYPE_1G_BASE_ZX },
{ "1GBASE-CX", SFF_MODULE_TYPE_1G_BASE_CX },
{ "1GBASE-T", SFF_MODULE_TYPE_1G_BASE_T },
Expand Down