From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 22:55:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7507E7D; Sat, 16 Aug 2014 22:55:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7938B2654; Sat, 16 Aug 2014 22:55:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GMtx3O013348; Sat, 16 Aug 2014 22:55:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GMtxgZ013347; Sat, 16 Aug 2014 22:55:59 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201408162255.s7GMtxgZ013347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 16 Aug 2014 22:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270069 - head/sbin/ifconfig 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.18-1 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: Sat, 16 Aug 2014 22:55:59 -0000 Author: melifaro Date: Sat Aug 16 22:55:58 2014 New Revision: 270069 URL: http://svnweb.freebsd.org/changeset/base/270069 Log: Clean up unused definitions. Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Sat Aug 16 21:53:44 2014 (r270068) +++ head/sbin/ifconfig/sfp.c Sat Aug 16 22:55:58 2014 (r270069) @@ -46,23 +46,6 @@ static const char rcsid[] = #include "ifconfig.h" -/* Definitions from Table 3.1 */ -#define SFP_MSA_IDENTIFIER 0 /* Type of transceiver (T. 3.2), 1B */ -#define SFP_MSA_CONNECTOR 2 /* Connector type (T. 3.3), 1B */ - -#define SFP_MSA_TRANSCEIVER_CLASS 3 /* Ethernet/Sonet/IB code, 1B */ - -#define SFP_MSA_VENDOR_NAME 20 /* ASCII vendor name, 16B */ -#define SFP_MSA_VENDOR_PN 40 /* ASCII vendor partnum, 16B */ -#define SFP_MSA_VENDOR_SN 68 /* ASCII vendor serialnum, 16B */ -#define SFP_MSA_VENDOR_DATE 84 /* Vendor's date code, 8B */ -#define SFP_MSA_DMONTYPE 92 /* Type of disagnostic monitoring, 1B */ - -/* Definitions from table 3.17 */ -#define SFP_DDM_TEMP 96 /* Module temperature, 2B */ -#define SFP_DDM_TXPOWER 102 /* Measured TX output power, 2B */ -#define SFP_DDM_RXPOWER 104 /* Measured RX input power, 2B */ - struct i2c_info; typedef int (read_i2c)(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len, caddr_t buf); @@ -219,10 +202,9 @@ get_sfp_identifier(struct i2c_info *ii, ii->f(ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&data); x = NULL; - if (data <= SFF_8472_ID_LAST) { - x = NULL; - //x = sff_8472_id[data]; - } else { + if (data <= SFF_8472_ID_LAST) + x = sff_8472_id[data]; + else { if (data > 0x80) x = "Vendor specific"; else @@ -267,7 +249,7 @@ printf_sfp_transceiver_descr(struct i2c_ /* Read bytes 3-10 at once */ ii->f(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, &xbuf[3]); - /* Check 10G first */ + /* Check 10G ethernet first */ tech_class = find_zero_bit(eth_10g, xbuf[3], 1); if (tech_class == NULL) { /* No match. Try 1G */ @@ -400,6 +382,10 @@ get_sfp_temp(struct i2c_info *ii, char * snprintf(buf, size, "%d.%d C", major, k / 100); } +/* + * Converts value in @xbuf to both milliwats and dBm + * human representation. + */ static void convert_power(struct i2c_info *ii, char *xbuf, char *buf, size_t size) {