On Wed, 2016-12-14 at 11:30 -0800, [email protected] wrote:
> From: Ben Greear <[email protected]>
>
> This fixes obtaining the rate info via sta_set_sinfo
> when the rx rate is invalid (for instance, on IBSS
> interface that has received no frames from one of its
> peers).
>
> This also fixes a more general issue with rinfo->flags
> not being properly initialized for legacy rates.
I'd say this is a bug in the ethtool code - everything assumes (and
everything else makes sure) the whole sinfo struct is initialized to 0
before getting passed to this function.
> +static int sta_set_rate_info_rx(struct sta_info *sta, struct
> rate_info *rinfo)
> {
> u16 rate = ACCESS_ONCE(sta_get_last_rx_stats(sta)-
> >last_rate);
> -
> - if (rate == STA_STATS_RATE_INVALID)
> - rinfo->flags = 0;
> - else
> + if (rate == STA_STATS_RATE_INVALID) {
> + return -EINVAL;
> + } else {
> sta_stats_decode_rate(sta->local, rate, rinfo);
> + return 0;
> + }
That's weird, I'll fix it.
Applied, with some fixupse.
johannes