From patchwork Fri Oct 2 23:03:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Albert X-Patchwork-Id: 51482 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 n92N3Y2U012963 for ; Fri, 2 Oct 2009 23:03:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754811AbZJBXD2 (ORCPT ); Fri, 2 Oct 2009 19:03:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754556AbZJBXD2 (ORCPT ); Fri, 2 Oct 2009 19:03:28 -0400 Received: from mail.gmx.net ([213.165.64.20]:58617 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754471AbZJBXD1 (ORCPT ); Fri, 2 Oct 2009 19:03:27 -0400 Received: (qmail invoked by alias); 02 Oct 2009 23:03:30 -0000 Received: from f055113016.adsl.alicedsl.de (EHLO [192.168.2.185]) [78.55.113.16] by mail.gmx.net (mp040) with SMTP; 03 Oct 2009 01:03:30 +0200 X-Authenticated: #3800222 X-Provags-ID: V01U2FsdGVkX18ReSx6CecRHeRXxg7jjP+Ofg4BnG+nTkm1oXbKnT omk/MUCXgkCZvq Message-ID: <4AC686C0.1050506@gmx.de> Date: Sat, 03 Oct 2009 01:03:28 +0200 From: Joerg Albert User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Malte Gell CC: Christian Lamparter , linux-wireless@vger.kernel.org, "Luis R. Rodriguez" , linville@tuxdriver.com, Hin-Tak Leung Subject: Re: [PATCH] ar9170usb: LEDs are confused References: <200910011654.10963.chunkeey@googlemail.com> <200910020852.36427.malte.gell@gmx.de> <200910021246.34699.chunkeey@googlemail.com> <200910021345.55567.malte.gell@gmx.de> <4AC67DEB.80900@gmx.de> In-Reply-To: <4AC67DEB.80900@gmx.de> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.63 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/ath/ar9170/hw.h b/drivers/net/wireless/ath/ar9170/hw.h index 6cbfb2f..74b619c 100644 --- a/drivers/net/wireless/ath/ar9170/hw.h +++ b/drivers/net/wireless/ath/ar9170/hw.h @@ -77,6 +77,7 @@ enum ar9170_cmd { #define AR9170_EP_IRQ 3 #define AR9170_EP_CMD 4 +#define AR9170_EEPROM_HWTYPE 0x1374 #define AR9170_EEPROM_START 0x1600 #define AR9170_GPIO_REG_BASE 0x1d0100 diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c index c1f8c69..bffd6c4 100644 --- a/drivers/net/wireless/ath/ar9170/main.c +++ b/drivers/net/wireless/ath/ar9170/main.c @@ -2598,6 +2598,7 @@ static int ar9170_read_eeprom(struct ar9170 *ar) __le32 offsets[RW]; unsigned int rx_streams, tx_streams, tx_params = 0; int i, j, err, bands = 0; + u32 hwtype; BUILD_BUG_ON(sizeof(ar->eeprom) & 3); @@ -2665,6 +2666,14 @@ static int ar9170_read_eeprom(struct ar9170 *ar) /* second part of wiphy init */ SET_IEEE80211_PERM_ADDR(ar->hw, addr); + /* read hw type (aka the led modes) */ + err = ar9170_read_reg(ar, AR9170_EEPROM_HWTYPE, &hwtype); + if (err) + return err; + /* jal: for debugging only */ + printk(KERN_INFO "%s: hwtype %08x\n", + wiphy_name(ar->hw->wiphy), hwtype); + return bands ? 0 : -EINVAL; }