diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-20 15:53:03 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-21 10:29:39 +0200 |
commit | 18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d (patch) | |
tree | a3020ac5b1f366f2f0920941b589808e435dbcee /freebsd/sbin/ifconfig | |
parent | Update to FreeBSD head 2017-12-01 (diff) | |
download | rtems-libbsd-18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d.tar.bz2 |
Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4.
Update #3472.
Diffstat (limited to 'freebsd/sbin/ifconfig')
-rw-r--r-- | freebsd/sbin/ifconfig/sfp.c | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/freebsd/sbin/ifconfig/sfp.c b/freebsd/sbin/ifconfig/sfp.c index b061927e..0aa3300d 100644 --- a/freebsd/sbin/ifconfig/sfp.c +++ b/freebsd/sbin/ifconfig/sfp.c @@ -88,7 +88,7 @@ struct _nv { const char *find_value(struct _nv *x, int value); const char *find_zero_bit(struct _nv *x, int value, int sz); -/* SFF-8472 Rev. 11.4 table 3.4: Connector values */ +/* SFF-8024 Rev. 4.1 Table 4-3: Connector Types */ static struct _nv conn[] = { { 0x00, "Unknown" }, { 0x01, "SC" }, @@ -106,7 +106,8 @@ static struct _nv conn[] = { { 0x20, "HSSDC II" }, { 0x21, "Copper pigtail" }, { 0x22, "RJ45" }, - { 0x23, "No separate connector" }, /* SFF-8436 */ + { 0x23, "No separable connector" }, + { 0x24, "MXC 2x16" }, { 0, NULL } }; @@ -202,10 +203,17 @@ static struct _nv eth_1040g[] = { }; #define SFF_8636_EXT_COMPLIANCE 0x80 -/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */ +/* SFF-8024 Rev. 4.2 table 4-4: Extended Specification Compliance */ static struct _nv eth_extended_comp[] = { { 0xFF, "Reserved" }, - { 0x1A, "2 lambda DWDM 100G" }, + { 0x21, "100G PAM4 BiDi" }, + { 0x20, "100G SWDM4" }, + { 0x1F, "40G SWDM4" }, + { 0x1E, "2.5GBASE-T" }, + { 0x1D, "5GBASE-T" }, + { 0x1C, "10GBASE-T Short Reach" }, + { 0x1B, "100G 1550nm WDM" }, + { 0x1A, "100GE-DWDM2" }, { 0x19, "100G ACC or 25GAUI C2M ACC" }, { 0x18, "100G AOC or 25GAUI C2M AOC" }, { 0x17, "100G CLR4" }, @@ -217,23 +225,24 @@ static struct _nv eth_extended_comp[] = { { 0x11, "4 x 10GBASE-SR" }, { 0x10, "40GBASE-ER4" }, { 0x0F, "Reserved" }, + { 0x0E, "Reserved" }, { 0x0D, "25GBASE-CR CA-N" }, { 0x0C, "25GBASE-CR CA-S" }, { 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" }, { 0x0A, "Reserved" }, - { 0x09, "100G CWDM4 MSA without FEC" }, - { 0x08, "100G ACC (Active Copper Cable)" }, + { 0x09, "Obsolete" }, + { 0x08, "100G ACC (Active Copper Cable) or 25GAUI C2M ACC" }, { 0x07, "100G PSM4 Parallel SMF" }, - { 0x06, "100G CWDM4 MSA with FEC" }, + { 0x06, "100G CWDM4" }, { 0x05, "100GBASE-SR10" }, - { 0x04, "100GBASE-ER4" }, - { 0x03, "100GBASE-LR4" }, - { 0x02, "100GBASE-SR4" }, - { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" }, + { 0x04, "100GBASE-ER4 or 25GBASE-ER" }, + { 0x03, "100GBASE-LR4 or 25GBASE-LR" }, + { 0x02, "100GBASE-SR4 or 25GBASE-SR" }, + { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M AOC" }, { 0x00, "Unspecified" } }; -/* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */ +/* SFF-8636 Rev. 2.9 table 6.3: Revision compliance */ static struct _nv rev_compl[] = { { 0x1, "SFF-8436 rev <=4.8" }, { 0x2, "SFF-8436 rev <=4.8" }, @@ -241,7 +250,8 @@ static struct _nv rev_compl[] = { { 0x4, "SFF-8636 rev <=1.4" }, { 0x5, "SFF-8636 rev <=1.5" }, { 0x6, "SFF-8636 rev <=2.0" }, - { 0x7, "SFF-8636 rev <=2.5" }, + { 0x7, "SFF-8636 rev <=2.7" }, + { 0x8, "SFF-8636 rev >=2.8" }, { 0x0, "Unspecified" } }; @@ -397,17 +407,20 @@ get_sfp_transceiver_class(struct i2c_info *ii, char *buf, size_t size) const char *tech_class; uint8_t code; - unsigned char qbuf[8]; - read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, (uint8_t *)qbuf); - - /* Check 10G Ethernet/IB first */ - read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code); - tech_class = find_zero_bit(eth_10g, code, 1); - if (tech_class == NULL) { - /* No match. Try Ethernet 1G */ - read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3, - 1, (caddr_t)&code); - tech_class = find_zero_bit(eth_compat, code, 1); + /* Use extended compliance code if it's valid */ + read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS, 1, &code); + if (code != 0) + tech_class = find_value(eth_extended_comp, code); + else { + /* Next, check 10G Ethernet/IB CCs */ + read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code); + tech_class = find_zero_bit(eth_10g, code, 1); + if (tech_class == NULL) { + /* No match. Try Ethernet 1G */ + read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3, + 1, (caddr_t)&code); + tech_class = find_zero_bit(eth_compat, code, 1); + } } if (tech_class == NULL) |