Search Linux Wireless

Re: [PATCH] wifi: mac80211: fix get inactive time for station mode

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

 



On Tue, 2022-06-28 at 17:05 +0200, Issam Hamdi wrote:
> In station mode, the value last_rx is not updated often.
> Therefore the calculation of the inactive time will be wrong (will give
> values between 1000 ms to 30000 ms).
> To fix this add the update of "sta->deflink.rx_stats.last_rx" for
> station mode in the response of the packets process
> (ieee80211_rx_h_sta_process).

Not really sure I understand that.

> +++ b/net/mac80211/rx.c
> @@ -1756,6 +1756,9 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
>  			sta->deflink.rx_stats.last_rate = sta_stats_encode_rate(status);
>  	}
>  
> +	if (rx->sdata->vif.type == NL80211_IFTYPE_STATION)
> +		sta->deflink.rx_stats.last_rx = jiffies;

Why the interface type check? It's a per-station thing, so why would it
not apply here for other types?

>  	sinfo->inactive_time =
> -		jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta));
> +		jiffies_to_msecs(abs(jiffies - ieee80211_sta_last_active(sta)));
> 

That seems ... rather questionable.

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux