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 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html