From patchwork Mon Sep 14 21:01:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Ilnseher X-Patchwork-Id: 47471 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 n8EL3Lan026440 for ; Mon, 14 Sep 2009 21:03:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757225AbZINVCf (ORCPT ); Mon, 14 Sep 2009 17:02:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757224AbZINVCf (ORCPT ); Mon, 14 Sep 2009 17:02:35 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:51426 "EHLO mail-fx0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757217AbZINVCc (ORCPT ); Mon, 14 Sep 2009 17:02:32 -0400 Received: by fxm17 with SMTP id 17so1146608fxm.37 for ; Mon, 14 Sep 2009 14:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=uOV+ellMYqbSoIvsaBdNYGLeAvphRYx+j7G5gdyrtRw=; b=kkY4wCqRruvUugaG7TRE+q7oEZ3oeC0ifd94Ohe6TLthGiOZun5q6nEIrbCC1F/274 pMNygKH7rP7yQoiUvZE3cm/+uMiuAacqzLhS4qxborAWzwnYQAiobDcJsGxf/S5dAPwe g9NTWRfSa7hxnzKckjzn6WHVbQRrobTXCWSPg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=AaOy4lWnbcIGPvHOMGR78hy0FlCzx6IxCKxoEin3SDiRN2Eukl1Kaq28CWXALJzWjN awf6Sv1hIgR0AIiCHwhocTc0siDXuccsUu5LCezEkV96nbtQSg0moUj7Q1ebeu0bIH87 14qXYFYwANztjRoNsM+j0NglfXFBaPGj17TIA= Received: by 10.86.227.13 with SMTP id z13mr5472372fgg.72.1252962154718; Mon, 14 Sep 2009 14:02:34 -0700 (PDT) Received: from ?192.168.178.22? (88-134-126-140-dynip.superkabel.de [88.134.126.140]) by mx.google.com with ESMTPS id 4sm38912fge.13.2009.09.14.14.02.34 (version=SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 14:02:34 -0700 (PDT) Subject: [PATCH] b43: Add LP PHY Analog Switch Support From: Thomas Ilnseher To: John Linville Cc: Broadcom Wireless , linux-wireless Date: Mon, 14 Sep 2009 23:01:33 +0200 Message-Id: <1252962093.4696.45.camel@luzifer.localnet> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The current verison of b43 uses "b43_phyop_switch_analog_generic" for A, G and LP phys. According to the spec, this is the wrong behaviour for the LP PHY (see: http://bcm-v4.sipsolutions.net/802.11/PHY/Anacore ) While no problems on the x86 plattform where seen, this leads to a crash on the BCM5354 SoC (MIPS 32 LE plattform). This patch implements the analog switch for LP PHYs according to the specs. It fixes the crash signed-off-by: Thomas Ilnseher --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -uNr b/drivers/net/wireless/b43/phy_lp.c a/drivers/net/wireless/b43/phy_lp.c --- b/drivers/net/wireless/b43/phy_lp.c 2009-09-14 06:14:18.000000000 +0200 +++ a/drivers/net/wireless/b43/phy_lp.c 2009-09-14 21:03:15.158507573 +0200 @@ -2228,6 +2228,16 @@ return B43_TXPWR_RES_DONE; } +void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on) +{ + if (on) { + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8); + } else { + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0x0007); + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 0x0007); + } +} + const struct b43_phy_operations b43_phyops_lp = { .allocate = b43_lpphy_op_allocate, .free = b43_lpphy_op_free, @@ -2239,7 +2249,7 @@ .radio_read = b43_lpphy_op_radio_read, .radio_write = b43_lpphy_op_radio_write, .software_rfkill = b43_lpphy_op_software_rfkill, - .switch_analog = b43_phyop_switch_analog_generic, + .switch_analog = b43_lpphy_op_switch_analog, .switch_channel = b43_lpphy_op_switch_channel, .get_default_chan = b43_lpphy_op_get_default_chan, .set_rx_antenna = b43_lpphy_op_set_rx_antenna,