linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Cc: b43-dev@lists.infradead.org, "Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH 3/5] b43: N-PHY: find table entry earlier for setting chanspec
Date: Mon, 29 Mar 2010 00:53:14 +0200	[thread overview]
Message-ID: <1269816796-26820-4-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1269816796-26820-2-git-send-email-zajec5@gmail.com>

We do not want to partially change chanspec just to find out there is not
entry in table for given channel.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/phy_n.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 052119b..d9e47ba 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -3343,6 +3343,10 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 
 	if (dev->phy.rev >= 3) {
 		/* TODO */
+	} else {
+		tabent = b43_nphy_get_chantabent(dev, channel);
+		if (!tabent)
+			return -ESRCH;
 	}
 
 	nphy->radio_chanspec = chanspec;
@@ -3366,10 +3370,6 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 		/* TODO: PHY Radio2056 Setup (chan_info_ptr[i]) */
 		/* TODO: N PHY Chanspec Setup (chan_info_ptr[i]) */
 	} else {
-		tabent = b43_nphy_get_chantabent(dev, channel);
-		if (!tabent)
-			return -ESRCH;
-
 		tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050;
 		b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp);
 		b43_radio_2055_setup(dev, tabent);
-- 
1.6.4.2


  parent reply	other threads:[~2010-03-28 22:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 22:53 [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls Rafał Miłecki
2010-03-28 22:53 ` [PATCH 2/5] b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields Rafał Miłecki
2010-03-28 22:53 ` Rafał Miłecki [this message]
2010-03-28 22:53 ` [PATCH 4/5] b43: N-PHY: prepare for rev3+ channel tables Rafał Miłecki
2010-03-28 22:53 ` [PATCH 5/5] b43: N-PHY: fix value written on 2055 radio setup Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1269816796-26820-4-git-send-email-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).