From patchwork Mon Jun 27 12:58:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 920652 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5RD37Bs026868 for ; Mon, 27 Jun 2011 13:03:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756672Ab1F0M74 (ORCPT ); Mon, 27 Jun 2011 08:59:56 -0400 Received: from mail-fx0-f52.google.com ([209.85.161.52]:42178 "EHLO mail-fx0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757318Ab1F0M6M (ORCPT ); Mon, 27 Jun 2011 08:58:12 -0400 Received: by mail-fx0-f52.google.com with SMTP id 18so1789080fxd.11 for ; Mon, 27 Jun 2011 05:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=iy9h2n7dXQ/APMg42hPf3A91ryI8rZiKq4S5OOx5VCA=; b=jBwwrFJa/aqQiXSieLeRKgD+AbwKkHpdbklIxmEyWzKtOGy0oFL3Xy8l53X4/LUAIo 4LJkfJfLg9BsK09W6MZkh3EOPExbrwhAwQjs2kW/+EiJXhg7RnVUvlsnPWXCgzQHhhFB qUYFB0fElGbhGbLPcPop7vYscjvD4xZL4RsXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; b=j9C3YhpZ/H1keoCLOUgXF5DruZuZFuzZRJObWRys0MpN/NGrSwwmKspnMeuTrCBSIX 5H/aHuIgl8iYOTUunnwAdlod2k3X8lTv4FlX5e0xDrsFridTaFjWUrmhtDVsQnIgRadS iGQoukS2HFvVKvjUGU3ZtnnhaU0XKQSJ03JAk= Received: by 10.223.94.78 with SMTP id y14mr8861675fam.24.1309179491635; Mon, 27 Jun 2011 05:58:11 -0700 (PDT) Received: from localhost.localdomain (acyg40.neoplus.adsl.tpnet.pl [83.11.190.40]) by mx.google.com with ESMTPS id h1sm3518539fag.11.2011.06.27.05.58.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Jun 2011 05:58:10 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: linux-wireless@vger.kernel.org, "John W. Linville" Cc: b43-dev@lists.infradead.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 3/5] b43: HT-PHY: perform some tables ops on channel switching Date: Mon, 27 Jun 2011 14:58:52 +0200 Message-Id: <1309179534-8081-3-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1309179534-8081-1-git-send-email-zajec5@gmail.com> References: <1309179534-8081-1-git-send-email-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Jun 2011 13:03:54 +0000 (UTC) Starring at MMIO dumps around PHY channel switching has led to finding serie of 3 similar ops this patch implements. Signed-off-by: Rafa? Mi?ecki --- The interesting part of MMIO dump: phy_write(0x01ce) <- 0x03dd phy_write(0x01cf) <- 0x03d9 phy_write(0x01d0) <- 0x03d5 phy_write(0x01d1) <- 0x0424 phy_write(0x01d2) <- 0x0429 phy_write(0x01d3) <- 0x042d >>> Uploading PHY tables end >>> Some magic ops start phy_read(0x00b0) -> 0x0df7 phy_read(0x00b0) -> 0x0df7 phy_write(0x00b0) <- 0x0df7 phy_read(0x0c0a) -> 0x0100 phy_write(0x0c0a) <- 0x0100 >>> Some magic ops end phy_write(0x0072) <- 0x68e8 phy_read(0x0073) -> 0x0033 phy_read(0x0074) -> 0x1019 phy_read(0x0908) -> 0x0000 phy_write(0x0908) <- 0x0000 phy_write(0x0072) <- 0x1d10 phy_write(0x0073) <- 0x1019 phy_write(0x0072) <- 0x3463 phy_write(0x0073) <- 0x0033 phy_write(0x0072) <- 0x3473 phy_write(0x0073) <- 0x0033 phy_write(0x0072) <- 0x68e8 phy_read(0x0073) -> 0x0033 phy_read(0x0074) -> 0x1019 phy_read(0x0908) -> 0x0000 phy_write(0x0908) <- 0x0000 phy_write(0x0072) <- 0x1d11 phy_write(0x0073) <- 0x1019 phy_write(0x0072) <- 0x3467 phy_write(0x0073) <- 0x0033 phy_write(0x0072) <- 0x3477 phy_write(0x0073) <- 0x0033 phy_write(0x0072) <- 0x68e8 phy_read(0x0073) -> 0x0033 phy_read(0x0074) -> 0x1019 phy_read(0x0908) -> 0x0000 phy_write(0x0908) <- 0x0000 phy_write(0x0072) <- 0x1d12 phy_write(0x0073) <- 0x1019 phy_write(0x0072) <- 0x346b phy_write(0x0073) <- 0x0033 phy_write(0x0072) <- 0x347b phy_write(0x0073) <- 0x0033 --- drivers/net/wireless/b43/phy_ht.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index c48bcf6..42bea30 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c @@ -24,6 +24,7 @@ #include "b43.h" #include "phy_ht.h" +#include "tables_phy_ht.h" #include "radio_2059.h" #include "main.h" @@ -83,6 +84,7 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev, struct ieee80211_channel *new_channel) { bool old_band_5ghz; + u8 i; old_band_5ghz = b43_phy_read(dev, B43_PHY_HT_BANDCTL) & 0; /* FIXME */ if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { @@ -97,6 +99,23 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev, b43_phy_write(dev, B43_PHY_HT_BW4, e->bw4); b43_phy_write(dev, B43_PHY_HT_BW5, e->bw5); b43_phy_write(dev, B43_PHY_HT_BW6, e->bw6); + + /* TODO: some ops on PHY regs 0x0B0 and 0xC0A */ + + /* TODO: separated function? */ + for (i = 0; i < 3; i++) { + u32 tmp = b43_httab_read(dev, B43_HTTAB32(26, 0xE8)); + + /* TODO: some op on PHY reg 0x908 */ + + b43_httab_write(dev, B43_HTTAB16(7, 0x110 + i), tmp >> 16); + b43_httab_write(dev, B43_HTTAB8(13, 0x63 + (i * 4)), + tmp & 0xFF); + b43_httab_write(dev, B43_HTTAB8(13, 0x73 + (i * 4)), + tmp & 0xFF); + } + + b43_phy_write(dev, 0x017e, 0x3830); } static int b43_phy_ht_set_channel(struct b43_wldev *dev,