From owner-svn-src-all@freebsd.org Mon Dec 28 09:26:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1664BA53E6C; Mon, 28 Dec 2015 09:26:09 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC8BA1729; Mon, 28 Dec 2015 09:26:08 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBS9Q7KZ030762; Mon, 28 Dec 2015 09:26:07 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBS9Q7sr030760; Mon, 28 Dec 2015 09:26:07 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512280926.tBS9Q7sr030760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 28 Dec 2015 09:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292831 - in head: sbin/ifconfig sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2015 09:26:09 -0000 Author: melifaro Date: Mon Dec 28 09:26:07 2015 New Revision: 292831 URL: https://svnweb.freebsd.org/changeset/base/292831 Log: Add SFF-8024 Extended Specification Compliance Submitted by: markb_mellanox.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4666 Modified: head/sbin/ifconfig/sfp.c head/sys/net/sff8436.h Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Mon Dec 28 09:03:29 2015 (r292830) +++ head/sbin/ifconfig/sfp.c Mon Dec 28 09:26:07 2015 (r292831) @@ -171,7 +171,7 @@ static struct _nv fc_speed[] = { /* 10/40G Ethernet compliance codes, byte 128 + 3 */ static struct _nv eth_1040g[] = { - { 0x80, "Reserved" }, + { 0x80, "Extended" }, { 0x40, "10GBASE-LRM" }, { 0x20, "10GBASE-LR" }, { 0x10, "10GBASE-SR" }, @@ -181,6 +181,38 @@ static struct _nv eth_1040g[] = { { 0x01, "40G Active Cable" }, { 0, NULL } }; +#define SFF_8636_EXT_COMPLIANCE 0x80 + +/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */ +static struct _nv eth_extended_comp[] = { + { 0xFF, "Reserved" }, + { 0x1A, "2 lambda DWDM 100G" }, + { 0x19, "100G ACC or 25GAUI C2M ACC" }, + { 0x18, "100G AOC or 25GAUI C2M AOC" }, + { 0x17, "100G CLR4" }, + { 0x16, "10GBASE-T with SFI electrical interface" }, + { 0x15, "G959.1 profile P1L1-2D2" }, + { 0x14, "G959.1 profile P1S1-2D2" }, + { 0x13, "G959.1 profile P1I1-2D1" }, + { 0x12, "40G PSM4 Parallel SMF" }, + { 0x11, "4 x 10GBASE-SR" }, + { 0x10, "40GBASE-ER4" }, + { 0x0F, "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)" }, + { 0x07, "100G PSM4 Parallel SMF" }, + { 0x06, "100G CWDM4 MSA with FEC" }, + { 0x05, "100GBASE-SR10" }, + { 0x04, "100GBASE-ER4" }, + { 0x03, "100GBASE-LR4" }, + { 0x02, "100GBASE-SR4" }, + { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" }, + { 0x00, "Unspecified" } +}; /* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */ static struct _nv rev_compl[] = { @@ -371,9 +403,16 @@ get_qsfp_transceiver_class(struct i2c_in const char *tech_class; uint8_t code; - /* Check 10/40G Ethernet class only */ - read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040G, 1, &code); - tech_class = find_zero_bit(eth_1040g, code, 1); + read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040100G, 1, &code); + + /* Check for extended specification compliance */ + if (code & SFF_8636_EXT_COMPLIANCE) { + read_i2c(ii, SFF_8436_BASE, SFF_8436_OPTIONS_START, 1, &code); + tech_class = find_value(eth_extended_comp, code); + } else + /* Check 10/40G Ethernet class only */ + tech_class = find_zero_bit(eth_1040g, code, 1); + if (tech_class == NULL) tech_class = "Unknown"; @@ -873,6 +912,7 @@ sfp_status(int s, struct ifreq *ifr, int switch (id_byte) { case SFF_8024_ID_QSFP: case SFF_8024_ID_QSFPPLUS: + case SFF_8024_ID_QSFP28: print_qsfp_status(&ii, verbose); break; default: Modified: head/sys/net/sff8436.h ============================================================================== --- head/sys/net/sff8436.h Mon Dec 28 09:03:29 2015 (r292830) +++ head/sys/net/sff8436.h Mon Dec 28 09:26:07 2015 (r292831) @@ -131,7 +131,7 @@ enum { SFF_8436_CONNECTOR = 130, /* Connector type (Table 32) */ SFF_8436_TRANS_START = 131, /* Electric or Optical Compatibility * (Table 33) */ - SFF_8436_CODE_E1040G = 131, /* 10/40G Ethernet Compliance Code */ + SFF_8436_CODE_E1040100G = 131, /* 10/40/100G Ethernet Compliance Code */ SFF_8436_CODE_SONET = 132, /* SONET Compliance codes */ SFF_8436_CODE_SATA = 133, /* SAS/SATA compliance codes */ SFF_8436_CODE_E1G = 134, /* Gigabit Ethernet Compliant codes */