Search Linux Wireless

[RFC v2 1/2] mac80211: Fix a race on enabling power save.

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

 



Vivek Natarajan wrote:
>  	if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
> -	    (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)))
> +	    (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED) ||
> +	     !(ifmgd->flags & IEEE80211_STA_PS_PENDING))) {
> +		ifmgd->flags |= IEEE80211_STA_PS_PENDING;
>  		ieee80211_send_nullfunc(local, sdata, 1);
> +	}
>  
>  	if (!((local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) &&
>  	      (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) ||
> -	    (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
> +	    ((ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED) &&
> +	      ifmgd->flags & IEEE80211_STA_PS_PENDING))  {
>  		ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
> +		ifmgd->flags &= ~IEEE80211_STA_PS_PENDING;
>  		local->hw.conf.flags |= IEEE80211_CONF_PS;
>  		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
>  	}
> +	ieee80211_wake_queues_by_reason(&local->hw,
> +					IEEE80211_QUEUE_STOP_REASON_PS);
>  }

The queues are activated when enabling powersave ?

>  void ieee80211_dynamic_ps_timer(unsigned long data)
> diff --git a/net/mac80211/status.c b/net/mac80211/status.c
> index 010a559..51caa0d 100644
> --- a/net/mac80211/status.c
> +++ b/net/mac80211/status.c
> @@ -315,7 +315,10 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
>  	    (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) &&
>  	    !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
>  	    local->ps_sdata && !(local->scanning)) {
> -		if (info->flags & IEEE80211_TX_STAT_ACK) {
> +		if ((info->flags & IEEE80211_TX_STAT_ACK) &&
> +		   (local->ps_sdata->u.mgd.flags & IEEE80211_STA_PS_PENDING)) {
> +			ieee80211_stop_queues_by_reason(&local->hw,
> +							IEEE80211_QUEUE_STOP_REASON_PS);

I am not too familiar with the PS code, but why are the queues being stopped
after the nullfunc frame has been sent out and acked ? And it is a bit unclear why
the new flag IEEE80211_STA_PS_PENDING is required at all... Can't IEEE80211_STA_NULLFUNC_ACKED
be used to fix this race ?

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