linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	bcm43xx-dev@lists.berlios.de
Subject: Re: [PATCH 11/11] b43: N-PHY: switch to chanspec ops
Date: Tue, 09 Feb 2010 14:23:06 -0600	[thread overview]
Message-ID: <4B71C42A.3090707@lwfinger.net> (raw)
In-Reply-To: <1265745883-3392-12-git-send-email-zajec5@gmail.com>

On 02/09/2010 02:04 PM, Rafał Miłecki wrote:
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
>  drivers/net/wireless/b43/phy_n.c |   87 +++++++++++++++++++++++++++-----------
>  drivers/net/wireless/b43/phy_n.h |    1 +
>  2 files changed, 63 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 19d4f11..49256bf 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -72,6 +72,7 @@ static void b43_nphy_rf_control_override(struct b43_wldev *dev, u16 field,
>  						u16 value, u8 core, bool off);
>  static void b43_nphy_rf_control_intc_override(struct b43_wldev *dev, u8 field,
>  						u16 value, u8 core);
> +static int nphy_channel_switch(struct b43_wldev *dev, unsigned int channel);
>  
>  static inline bool b43_empty_chanspec(struct b43_chanspec *chanspec)
>  {
> @@ -172,31 +173,6 @@ static void b43_radio_2055_setup(struct b43_wldev *dev,
>  	udelay(300);
>  }
>  
> -/* Tune the hardware to a new channel. */
> -static int nphy_channel_switch(struct b43_wldev *dev, unsigned int channel)
> -{
> -	const struct b43_nphy_channeltab_entry *tabent;
> -
> -	tabent = b43_nphy_get_chantabent(dev, channel);
> -	if (!tabent)
> -		return -ESRCH;
> -
> -	//FIXME enable/disable band select upper20 in RXCTL
> -	if (0 /*FIXME 5Ghz*/)
> -		b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, 0x20);
> -	else
> -		b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, 0x50);
> -	b43_radio_2055_setup(dev, tabent);
> -	if (0 /*FIXME 5Ghz*/)
> -		b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ);
> -	else
> -		b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ);
> -	b43_chantab_phy_upload(dev, tabent);
> -	b43_nphy_tx_power_fix(dev);
> -
> -	return 0;
> -}
> -
>  static void b43_radio_init2055_pre(struct b43_wldev *dev)
>  {
>  	b43_phy_mask(dev, B43_NPHY_RFCTL_CMD,
> @@ -3345,6 +3321,67 @@ static void b43_nphy_chanspec_setup(struct b43_wldev *dev,
>  		b43_nphy_spur_workaround(dev);
>  }
>  
> +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/SetChanspec */
> +static int b43_nphy_set_chanspec(struct b43_wldev *dev,
> +					struct b43_chanspec chanspec)
> +{
> +	struct b43_phy_n *nphy = dev->phy.n;
> +
> +	const struct b43_nphy_channeltab_entry *tabent;
> +
> +	u8 tmp;
> +	u8 channel = chanspec.channel;
> +
> +	if (dev->phy.rev >= 3) {
> +		/* TODO */
> +	}
> +
> +	nphy->radio_chanspec = chanspec;
> +
> +	if (chanspec.b_width != nphy->b_widht)
> +		; /* TODO: BMAC BW Set (chanspec.b_width) */
> +
> +	/* TODO: use defines */
> +	if (chanspec.b_width == 3) {
> +		if (chanspec.sideband == 2)
> +			b43_phy_set(dev, B43_NPHY_RXCTL,
> +					B43_NPHY_RXCTL_BSELU20);
> +		else
> +			b43_phy_mask(dev, B43_NPHY_RXCTL,
> +					~B43_NPHY_RXCTL_BSELU20);
> +	}
> +
> +	if (dev->phy.rev >= 3) {
> +		tmp = (chanspec.b_freq == 1) ? 4 : 0;
> +		b43_radio_maskset(dev, 0x08, 0xFFFB, tmp);
> +		/* 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);
> +		b43_nphy_chanspec_setup(dev, tabent, chanspec);
> +	}
> +
> +	return 0;
> +}
> +
> +/* Tune the hardware to a new channel */
> +static int nphy_channel_switch(struct b43_wldev *dev, unsigned int channel)
> +{
> +	struct b43_phy_n *nphy = dev->phy.n;
> +
> +	struct b43_chanspec chanspec;
> +	chanspec = nphy->radio_chanspec;
> +	chanspec.channel = channel;
> +
> +	return b43_nphy_set_chanspec(dev, chanspec);
> +}
> +
>  static int b43_nphy_op_allocate(struct b43_wldev *dev)
>  {
>  	struct b43_phy_n *nphy;
> diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
> index e7acae2..26d01fe 100644
> --- a/drivers/net/wireless/b43/phy_n.h
> +++ b/drivers/net/wireless/b43/phy_n.h
> @@ -984,6 +984,7 @@ struct b43_phy_n {
>  	u16 papd_epsilon_offset[2];
>  	s32 preamble_override;
>  	u32 bb_mult_save;
> +	u8 b_widht;

Typo here?

>  	struct b43_chanspec radio_chanspec;
>  
>  	bool gain_boost;


  reply	other threads:[~2010-02-09 20:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 20:04 [PATCH 01/11] b43: N-PHY: add some registers and structs definitions Rafał Miłecki
2010-02-09 20:04 ` [PATCH 02/11] b43: N-PHY: initialize super switch Rafał Miłecki
2010-02-09 20:04 ` [PATCH 03/11] b43: N-PHY: turn radio on/off (rfkill) Rafał Miłecki
2010-02-09 20:04 ` [PATCH 04/11] b43: N-PHY: update writing channel-specific radio registers Rafał Miłecki
2010-02-09 20:04 ` [PATCH 05/11] b43: N-PHY: update post init of 2055 radio Rafał Miłecki
2010-02-09 20:04 ` [PATCH 06/11] b43: N-PHY: switch to chanspec struct Rafał Miłecki
2010-02-09 20:04 ` [PATCH 07/11] b43: N-PHY: adjust gain table Rafał Miłecki
2010-02-09 20:04 ` [PATCH 08/11] b43: implement writing to MMIO shared memory Rafał Miłecki
2010-02-09 22:59   ` Michael Buesch
2010-02-27 11:09     ` Rafał Miłecki
2010-02-27 14:50       ` Michael Buesch
2010-02-09 20:04 ` [PATCH 09/11] b43: N-PHY: isloate 2055 radio setup Rafał Miłecki
2010-02-09 23:01   ` Michael Buesch
2010-02-09 20:04 ` [PATCH 10/11] b43: N-PHY: implement chanspec setup Rafał Miłecki
2010-02-09 20:04 ` [PATCH 11/11] b43: N-PHY: switch to chanspec ops Rafał Miłecki
2010-02-09 20:23   ` Larry Finger [this message]
2010-02-09 23:02 ` [PATCH 01/11] b43: N-PHY: add some registers and structs definitions Michael Buesch
2010-02-15 19:30   ` John W. Linville
2010-02-19 16:12     ` Rafał Miłecki
2010-02-27 11:12   ` Rafał Miłecki
2010-02-27 14:51     ` Michael Buesch
2010-02-28  1:37       ` Rafał Miłecki
2010-02-28 11:46         ` Michael Buesch
2010-02-19 14:54 ` Johannes Berg
2010-02-19 15:49   ` Larry Finger
2010-02-19 16:23     ` Johannes Berg
2010-02-19 16:40       ` Larry Finger
2010-02-19 17:02         ` Johannes Berg
2010-02-19 17:06           ` Gábor Stefanik
2010-02-19 17:09             ` Johannes Berg
2010-02-19 18:21               ` Gábor Stefanik
2010-02-19 18:24                 ` Johannes Berg
2010-02-19 18:33                   ` Gábor Stefanik
2010-02-19 18:41                     ` Johannes Berg
2010-02-19 18:10           ` Larry Finger
2010-02-19 18:19             ` Johannes Berg

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=4B71C42A.3090707@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=zajec5@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).