Re: [PATCH] Make possible speeds known to ethtool

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rick Jones
Date: Thursday, January 8, 2009 - 12:50 pm

> 

Something along these lines then? (assuming my mailer doesn't fubar this
:( - I normally send matches via mailx)

--- 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;
         };

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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Make possible speeds known to ethtool, Rick Jones, (Wed Jan 7, 7:03 pm)
Re: [PATCH] Make possible speeds known to ethtool, Jeff Garzik, (Wed Jan 7, 8:12 pm)
Re: [PATCH] Make possible speeds known to ethtool, Ben Hutchings, (Wed Jan 7, 8:14 pm)
Re: [PATCH] Make possible speeds known to ethtool, Rick Jones, (Thu Jan 8, 12:11 pm)
Re: [PATCH] Make possible speeds known to ethtool, Ben Hutchings, (Thu Jan 8, 12:25 pm)
Re: [PATCH] Make possible speeds known to ethtool, Rick Jones, (Thu Jan 8, 12:50 pm)
Re: [PATCH] Make possible speeds known to ethtool, Herbert Xu, (Thu Jan 8, 7:52 pm)
Re: [PATCH] Make possible speeds known to ethtool, Jeff Garzik, (Thu Jan 8, 8:20 pm)
[PATCH] ethtool: Support arbitrary speeds, Ben Hutchings, (Fri Jan 9, 6:16 am)
Re: [PATCH] ethtool: Support arbitrary speeds, Rick Jones, (Fri Jan 9, 10:55 am)
Re: [PATCH] ethtool: Support arbitrary speeds, Ben Hutchings, (Fri Jan 9, 11:24 am)
Re: [PATCH] ethtool: Support arbitrary speeds, Rick Jones, (Fri Jan 9, 11:40 am)
Re: [PATCH] Make possible speeds known to ethtool, Jeff Garzik, (Fri Mar 6, 4:19 am)
Re: [PATCH] ethtool: Support arbitrary speeds, Jeff Garzik, (Fri Mar 6, 4:20 am)
Re: [PATCH] ethtool: Support arbitrary speeds, Jeff Garzik, (Fri Mar 6, 5:27 am)
Re: [PATCH] Make possible speeds known to ethtool, Herbert Xu, (Fri Mar 6, 6:52 am)