Search Linux Wireless

Re: [PATCH] mac80211: make retry limits part of hw config

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

 



On Saturday 11 October 2008 01:53:55 Johannes Berg wrote:
>  static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
>  {
>  	struct b43_wl *wl = hw_to_b43_wl(hw);
> @@ -3333,6 +3349,20 @@ static int b43_op_config(struct ieee8021
>  
>  	mutex_lock(&wl->mutex);
>  
> +	if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
> +		dev = wl->current_dev;
> +		if (unlikely(!dev || (b43_status(dev) < B43_STAT_INITIALIZED))) {
> +			err = -ENODEV;
> +			goto out_unlock_mutex;
> +		}
> +		b43_set_retry_limits(dev, conf->short_frame_max_tx_count,
> +					  conf->long_frame_max_tx_count);
> +		changed &= ~IEEE80211_CONF_CHANGE_RETRY_LIMITS;
> +	}
> +
> +	if (!changed)
> +		goto out_unlock_mutex;
> +
>  	/* Switch the band (if necessary). This might change the active core. */
>  	err = b43_switch_band(wl, conf->channel);
>  	if (err)

This must be done _after_ bandswitch. (You also have a valid dev pointer there.
Just do it after the checks done there).

> @@ -2570,10 +2584,27 @@ static int b43legacy_op_dev_config(struc
>  	int err = 0;
>  	u32 savedirqs;
>  
> +	mutex_lock(&wl->mutex);
> +	dev = wl->current_dev;
> +
> +	if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
> +		if (unlikely(!dev ||
> +			     (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED))) {
> +			err = -ENODEV;
> +			goto out_unlock_mutex;
> +		}
> +		b43legacy_set_retry_limits(dev,
> +					   conf->short_frame_max_tx_count,
> +					   conf->long_frame_max_tx_count);
> +		changed &= ~IEEE80211_CONF_CHANGE_RETRY_LIMITS;
> +	}
> +
> +	if (!changed)
> +		goto out_unlock_mutex;
> +
>  	antenna_tx = B43legacy_ANTENNA_DEFAULT;
>  	antenna_rx = B43legacy_ANTENNA_DEFAULT;
>  
> -	mutex_lock(&wl->mutex);
>  	dev = wl->current_dev;

This also is a bit fishy.

>  	phy = &dev->phy;
>  
> @@ -2989,20 +3020,6 @@ static void b43legacy_imcfglo_timeouts_w
>  #endif /* CONFIG_SSB_DRIVER_PCICORE */
>  }
>  

-- 
Greetings Michael.
--
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