From patchwork Fri Jul 13 14:35:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Forest Bond X-Patchwork-Id: 1196051 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 034B13FC4C for ; Fri, 13 Jul 2012 14:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757760Ab2GMOfx (ORCPT ); Fri, 13 Jul 2012 10:35:53 -0400 Received: from storm.alittletooquiet.net ([67.23.28.199]:45383 "EHLO storm.alittletooquiet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753807Ab2GMOfw (ORCPT ); Fri, 13 Jul 2012 10:35:52 -0400 Received: by storm.alittletooquiet.net (Postfix, from userid 1000) id 0CCFF45767; Fri, 13 Jul 2012 10:35:52 -0400 (EDT) Date: Fri, 13 Jul 2012 10:35:51 -0400 From: Forest Bond To: John W Linville Cc: Larry Finger , linux-wireless@vger.kernel.org Subject: [PATCH] rtlwifi: rtl8192de: Fix phy-based version calculation Message-ID: <20120713143551.GF9489@alittletooquiet.net> MIME-Version: 1.0 Content-Disposition: inline X-PGP-Key: http://www.alittletooquiet.net/media/forest.pubkey.asc X-PGP-Fingerprint: 428A 6D9B EFEC EC9E 5E48 6B8F 44EE 1F41 076F E40C X-PGP-Affinity: will accept encrypted message for GPG X-Home-Page: http://www.alittletooquiet.net/ X-Accept-Language: en Jabber-ID: forestatq@jabber.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Forest Bond Commit d83579e2a50ac68389e6b4c58b845c702cf37516 incorporated some changes from the vendor driver that made it newly important that the calculated hardware version correctly include the CHIP_92D bit, as all of the IS_92D_* macros were changed to depend on it. However, this bit was being unset for dual-mac, dual-phy devices. The vendor driver behavior was modified to not do this, but unfortunately this change was not picked up along with the others. This caused scanning in the 2.4GHz band to be broken, and possibly other bugs as well. This patch brings the version calculation logic in parity with the vendor driver in this regard, and in doing so fixes the regression. However, the version calculation code in general continues to be largely incoherent and messy, and needs to be cleaned up. Signed-off-by: Forest Bond --- drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c index 18380a7..4420312 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c @@ -3345,21 +3345,21 @@ void rtl92d_phy_config_macphymode_info(struct ieee80211_hw *hw) switch (rtlhal->macphymode) { case DUALMAC_SINGLEPHY: rtlphy->rf_type = RF_2T2R; - rtlhal->version |= CHIP_92D_SINGLEPHY; + rtlhal->version |= RF_TYPE_2T2R; rtlhal->bandset = BAND_ON_BOTH; rtlhal->current_bandtype = BAND_ON_2_4G; break; case SINGLEMAC_SINGLEPHY: rtlphy->rf_type = RF_2T2R; - rtlhal->version |= CHIP_92D_SINGLEPHY; + rtlhal->version |= RF_TYPE_2T2R; rtlhal->bandset = BAND_ON_BOTH; rtlhal->current_bandtype = BAND_ON_2_4G; break; case DUALMAC_DUALPHY: rtlphy->rf_type = RF_1T1R; - rtlhal->version &= (~CHIP_92D_SINGLEPHY); + rtlhal->version &= RF_TYPE_1T1R; /* Now we let MAC0 run on 5G band. */ if (rtlhal->interfaceindex == 0) { rtlhal->bandset = BAND_ON_5G;