linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: "Gábor Stefanik" <netrolller.3d@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	John Linville <linville@tuxdriver.com>,
	Broadcom Wireless <bcm43xx-dev@lists.berlios.de>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio
Date: Thu, 13 Aug 2009 19:40:52 +0200	[thread overview]
Message-ID: <200908131940.52830.mb@bu3sch.de> (raw)
In-Reply-To: <4A842AFD.1020903@gmail.com>

On Thursday 13 August 2009 17:02:21 Gábor Stefanik wrote:
> Rev.2+/B2063 will now hopefully show some signs of life, though
> it won't work at full performance, as calibration is still missing.
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>

>  static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
> @@ -1369,7 +1370,7 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
>  	lpphy_baseband_init(dev);
>  	lpphy_radio_init(dev);
>  	lpphy_calibrate_rc(dev);
> -	//TODO set channel
> +	b43_switch_channel(dev, dev->wl->hw->conf.channel->hw_value);

Does dev->wl->hw->conf.channel->hw_value already have a sane value here?
Also please call b43_lpphy_op_switch_channel() instead of b43_switch_channel().

> +static void lpphy_b2063_tune(struct b43_wldev *dev,
> +			     unsigned int channel)
> +{
> +	struct ssb_bus *bus = dev->dev->bus;
> +
> +	struct b2063_channel chandata;
> +	u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
> +	u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count;
> +	u16 old_comm15, scale;
> +	u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
> +	int i, div = (crystal_freq <= 26000000 ? 1 : 2);
> +
> +	memset(&chandata, 0, sizeof(chandata));
> +
> +	for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> +		if (b2063_chantbl[i].channel == channel) {
> +			chandata = b2063_chantbl[i];

Can you use a const pointer instead of copying the whole data structure?

> +			break;
> +		}
> +	}
> +
> +	B43_WARN_ON(!chandata.channel);

> +
>  static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
>  				       unsigned int new_channel)
>  {
> -	//TODO
> +	struct b2063_channel chandata;
> +	int i;
> +
> +	memset(&chandata, 0, sizeof(chandata));
> +
> +	//FIXME this abuses the 2063 channel table for chan2freq purposes!
> +	for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> +		if (b2063_chantbl[i].channel == new_channel) {
> +			chandata = b2063_chantbl[i];
> +			break;
> +		}
> +	}
> +
> +	B43_WARN_ON(!chandata.channel);
> +
> +	/* FIXME this should be the last thing done, even after generic
> +	 * parts - does it matter?

It is correct as is.

> +	 * SPEC FIXME should this write channel, freq, chanspec or cookie?
> +	 */

Can you explain this FIXME? What's "chanspec", what's "cookie"?

> +	b43_write16(dev, B43_MMIO_CHANNEL, new_channel);
> +	if (dev->phy.radio_ver == 0x2063) {
> +		lpphy_b2063_tune(dev, new_channel);
> +	} else {
> +		lpphy_b2062_tune(dev, new_channel);
> +		//TODO Japan filter
> +	}
> +	lpphy_adjust_gain_table(dev, chandata.freq);
>  	return 0;
>  }
>  



-- 
Greetings, Michael.

  parent reply	other threads:[~2009-08-13 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13 15:02 [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio Gábor Stefanik
2009-08-13 15:45 ` Larry Finger
2009-08-13 17:40 ` Michael Buesch [this message]
     [not found]   ` <69e28c910908131050m94a0246s63b5aa57c7b25606@mail.gmail.com>
     [not found]     ` <200908131955.32283.mb@bu3sch.de>
2009-08-13 18:00       ` Gábor Stefanik
2009-08-13 18:05         ` Michael Buesch
2009-08-13 19:05           ` Larry Finger

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=200908131940.52830.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netrolller.3d@gmail.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).