Search Linux Wireless

Re: [PATCH 1/2] iwlwifi: fix set_tx_power vs scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wey

On Wed, Oct 13, 2010 at 08:18:20AM -0700, Guy, Wey-Yi wrote:
> >  		IWL_WARN(priv,
> >  			 "Requested user TXPOWER %d below lower limit %d.\n",
> > @@ -1226,6 +1228,12 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
> >  		return -EINVAL;
> >  	}
> >  
> > +	if (test_bit(STATUS_SCANNING, &priv->status)) {
> > +		priv->tx_power_next = tx_power;
> > +		IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n");
> > +		return 0;
> > +	}
> > +
[snip]
> >  	/* Since setting the TXPOWER may have been deferred while
> >  	 * performing the scan, fire one off */
> > -	iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
> > +	iwl_set_tx_power(priv, priv->tx_power_next, true);

Doh, this patch introduce a bug, when tx_power_next is not set (because
there was no scan during set_tx_power), but then when someone request
a scan and it finish, tx_power_next is written to hardware. I should
read tx_power using device sysfs not iwconfig when testing, will fix
that.

> Looks good, the only thing is if priv->tx_power_user_lmt ==
> priv->tx_power_next, we don't even have to call set_tx_power, but I
> guess calling it won't hurt, so its your decision check or not.

I'll will call iwl_set_tx_power( ... , false); what seems to be right
thing to do.

Stanislaw
--
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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux