All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Michael Buesch <mb@bu3sch.de>
Cc: bcm43xx-dev@lists.berlios.de,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 1/5] b43: N-PHY: implement b43_nphy_stay_carrier_search and it's calls
Date: Wed, 06 Jan 2010 10:36:32 -0600	[thread overview]
Message-ID: <4B44BC10.1050308@lwfinger.net> (raw)
In-Reply-To: <201001061650.52062.mb@bu3sch.de>

On 01/06/2010 09:50 AM, Michael Buesch wrote:
> On Wednesday 06 January 2010 16:40:32 Rafał Miłecki wrote:
>> b43: N-PHY: implement b43_nphy_stay_carrier_search and it's calls
> 
> Hm, The phrase "stay carrier earch" doesn't make a lot of sense to me.
> Is "stray carrier search" or something like that meant?
> Not that I care much, but I'm just wondering if this is just a typo.

"stay in carrier search"

> 
>> +static void b43_nphy_write_clip_detection(struct b43_wldev *dev, u16 *vals)
> 
> We know that these values are the clip thresholds, so use a better variable name, please.
> 
>> +{
>> +	b43_phy_write(dev, B43_NPHY_C1_CLIP1THRES, vals[0]);
>> +	b43_phy_write(dev, B43_NPHY_C2_CLIP1THRES, vals[1]);
>> +}
>> +
>> +static void b43_nphy_read_clip_detection(struct b43_wldev *dev, u16 *vals)
>> +{
>> +	vals[0] = b43_phy_read(dev, B43_NPHY_C1_CLIP1THRES);
>> +	vals[1] = b43_phy_read(dev, B43_NPHY_C2_CLIP1THRES);
>> +}
>> +
>> +static u16 b43_nphy_classifier(struct b43_wldev *dev, u16 mask, u16 val)
>> +{
>> +	u16 tmp;
>> +	bool suspended = false;
>> +
>> +	if (dev->dev->id.revision == 16 && dev->mac_suspended == 0) {
> 
> Do not check for mac_suspended==0 here. b43_mac_suspended does this internally.
> 
>> +		b43_mac_suspend(dev);
>> +		suspended = true;
>> +	}
>> +
>> +	tmp = b43_phy_read(dev, B43_NPHY_CLASSCTL);
>> +	tmp &= (B43_NPHY_CLASSCTL_CCKEN | B43_NPHY_CLASSCTL_OFDMEN |
>> +		B43_NPHY_CLASSCTL_WAITEDEN);
>> +	tmp &= ~mask;
>> +	tmp |= (val & mask);
>> +	b43_phy_maskset(dev, B43_NPHY_CLASSCTL, 0xFFF8, tmp);
>> +
>> +	if (suspended)
>> +		b43_mac_enable(dev);
>> +
>> +	return tmp;
>> +}
>> +
>> +static void b43_nphy_stay_carrier_search(struct b43_wldev *dev, bool enable)
>> +{
>> +	struct b43_phy *phy = &dev->phy;
>> +	struct b43_phy_n *nphy = phy->n;
>> +
>> +	if (enable) {
>> +		u16 clip[] = { 0xFFFF, 0xFFFF };
>> +		if (nphy->deaf_count++ == 0) {
>> +			nphy->classifier_state = b43_nphy_classifier(dev, 0, 0);
>> +			b43_nphy_classifier(dev, 0x7, 0);
>> +			b43_nphy_read_clip_detection(dev, nphy->clip_state);
>> +			b43_nphy_write_clip_detection(dev, clip);
>> +		}
>> +		b43_nphy_reset_cca(dev);
>> +	} else {
>> +		if (--nphy->deaf_count != 0) {
> 
> If this test logic correct? The following would make more sense to me:
> 
> 		if (--nphy->deaf_count == 0) {

It should be == 0. Specs match Broadcom code.


Larry


  reply	other threads:[~2010-01-06 16:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 15:40 [PATCH 1/5] b43: N-PHY: implement b43_nphy_stay_carrier_search and it's calls Rafał Miłecki
2010-01-06 15:46 ` Rafał Miłecki
2010-01-06 15:50 ` Michael Buesch
2010-01-06 16:36   ` Larry Finger [this message]
2010-01-06 20:11   ` Rafał Miłecki
2010-01-06 20:54     ` [PATCH 1/5] b43: N-PHY: implement b43_nphy_stay_in_carrier_search and it's calls (V2) Rafał Miłecki
2010-01-06 22:35       ` Gábor Stefanik
2010-01-06 22:36         ` Gábor Stefanik
2010-01-06 22:45         ` Rafał Miłecki
2010-01-06 22:49           ` Gábor Stefanik
2010-01-06 22:59             ` Larry Finger
2010-01-06 23:12               ` Rafał Miłecki
2010-01-06 23:32                 ` Gábor Stefanik

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=4B44BC10.1050308@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.