From patchwork Thu Oct 1 15:18:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John W. Linville" X-Patchwork-Id: 50981 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n91FKCte024904 for ; Thu, 1 Oct 2009 15:20:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754411AbZJAPTw (ORCPT ); Thu, 1 Oct 2009 11:19:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753387AbZJAPTw (ORCPT ); Thu, 1 Oct 2009 11:19:52 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:33387 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbZJAPTt (ORCPT ); Thu, 1 Oct 2009 11:19:49 -0400 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1MtNRg-0002Xi-3a; Thu, 01 Oct 2009 11:19:52 -0400 Received: from linville-t400.local (linville-t400.local [127.0.0.1]) by linville-t400.local (8.14.3/8.14.3) with ESMTP id n91FIKec014243; Thu, 1 Oct 2009 11:18:20 -0400 Received: (from linville@localhost) by linville-t400.local (8.14.3/8.14.3/Submit) id n91FIKOm014242; Thu, 1 Oct 2009 11:18:20 -0400 Date: Thu, 1 Oct 2009 11:18:20 -0400 From: "John W. Linville" To: Kalle Valo Cc: "Luis R. Rodriguez" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 0/2] cfg80211: firmware and hardware version Message-ID: <20091001151820.GA2895@tuxdriver.com> References: <20090924180048.14503.9579.stgit@tikku> <43e72e890909241320j592e347die8a14f8bdd962ffb@mail.gmail.com> <20090925044258.GA2722@tuxdriver.com> <43e72e890909250953r1714c79bsa679b96ca6f5797@mail.gmail.com> <20091001011340.GA3123@tuxdriver.com> <87fxa3qjt2.fsf@purkki.valot.fi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87fxa3qjt2.fsf@purkki.valot.fi> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/Makefile.am b/Makefile.am index eac65fe..a384949 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy.h ethtool-util.h \ amd8111e.c de2104x.c e100.c e1000.c igb.c \ fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c \ pcnet32.c realtek.c tg3.c marvell.c vioc.c \ - smsc911x.c + smsc911x.c at76c50x-usb.c dist-hook: cp $(top_srcdir)/ethtool.spec $(distdir) diff --git a/at76c50x-usb.c b/at76c50x-usb.c new file mode 100644 index 0000000..295d1cb --- /dev/null +++ b/at76c50x-usb.c @@ -0,0 +1,32 @@ +#include +#include "ethtool-util.h" + +static char hw_versions[] = { + "503_ISL3861", + "503_ISL3863", + " 503", + " 503_ACC", + " 505", + " 505_2958", + " 505A", + " 505AMX", +}; + +int +at76c50x_usb_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs) +{ + u8 version = (u8)(regs->version >> 24); + u8 rev_id = (u8)(regs->version); + char *ver_string; + + if(version != 0) + return -1; + + ver_string = hw_versions[rev_id]; + fprintf(stdout, + "Hardware Version %s\n", + ver_string); + + return 0; +} + diff --git a/ethtool.c b/ethtool.c index 0110682..7608750 100644 --- a/ethtool.c +++ b/ethtool.c @@ -1189,6 +1189,7 @@ static struct { { "sky2", sky2_dump_regs }, { "vioc", vioc_dump_regs }, { "smsc911x", smsc911x_dump_regs }, + { "at76c50x-usb", at76c50x_usb_dump_regs }, }; static int dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)