From patchwork Thu Jan 8 19:50:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Jones X-Patchwork-Id: 17402 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C6725474CF for ; Fri, 9 Jan 2009 06:50:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753690AbZAHTuK (ORCPT ); Thu, 8 Jan 2009 14:50:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753439AbZAHTuK (ORCPT ); Thu, 8 Jan 2009 14:50:10 -0500 Received: from g4t0017.houston.hp.com ([15.201.24.20]:2483 "EHLO g4t0017.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752507AbZAHTuJ (ORCPT ); Thu, 8 Jan 2009 14:50:09 -0500 Received: from tardy.cup.hp.com (tardy.cup.hp.com [16.89.104.60]) by g4t0017.houston.hp.com (Postfix) with ESMTP id 6A5E5381EE; Thu, 8 Jan 2009 19:50:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id LAA21920; Thu, 8 Jan 2009 11:50:03 -0800 (PST) Message-ID: <496658EB.1080206@hp.com> Date: Thu, 08 Jan 2009 11:50:03 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.13) Gecko/20060601 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ben Hutchings CC: Jeff Garzik , netdev@vger.kernel.org Subject: Re: [PATCH] Make possible speeds known to ethtool References: <200901080203.SAA19103@tardy.cup.hp.com> <1231384446.2677.32.camel@hashbaz.i.decadent.org.uk> <49656F01.3090603@pobox.com> <49664FFD.1010608@hp.com> <1231442701.3893.4.camel@achroite> In-Reply-To: <1231442701.3893.4.camel@achroite> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > I think 0, (u32)(-1) and (u16)(-1) may have to be special-cased as > unknown, but everything else can be treated as a number of Mbit/s. I > don't know what a driver should do about an interface that really runs > at 65.535 Gbit/s though... Something along these lines then? (assuming my mailer doesn't fubar this :( - I normally send matches via mailx) If that looks reasonable I'll post a proper one with the apropriate text and such with mailx... rick jones --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- ethtool.c.orig 2008-11-17 11:53:40.000000000 -0800 +++ ethtool.c 2009-01-08 11:41:54.000000000 -0800 @@ -813,23 +813,12 @@ static int dump_ecmd(struct ethtool_cmd fprintf(stdout, " Speed: "); switch (ep->speed) { - case SPEED_10: - fprintf(stdout, "10Mb/s\n"); - break; - case SPEED_100: - fprintf(stdout, "100Mb/s\n"); - break; - case SPEED_1000: - fprintf(stdout, "1000Mb/s\n"); - break; - case SPEED_2500: - fprintf(stdout, "2500Mb/s\n"); - break; - case SPEED_10000: - fprintf(stdout, "10000Mb/s\n"); + case 0: + case (u16)(-1): + fprintf(stdout, "Unknown! (%i)\n", ep->speed); break; default: - fprintf(stdout, "Unknown! (%i)\n", ep->speed); + fprintf(stdout, "%dMb/s\n", ep->speed); break; };