2012-08-12 16:25:20

by Antonio Quartulli

[permalink] [raw]
Subject: [PATCH] mac80211: add supported rates change notification in IBSS

In IBSS it is possible that the supported rates set for a station changes over
time (e.g. it gets first initialised as an empty set because of no available
information about rates and updated later). In this case the driver has to be
notified about the change in order to update its internal table accordingly (if
needed).

This behaviour is needed by all those drivers that handle rc internally but
leave stations management to mac80211

Reported-by: Gui Iribarren <[email protected]>
Signed-off-by: Antonio Quartulli <[email protected]>
---
include/net/mac80211.h | 1 +
net/mac80211/ibss.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index bb86aa6..9b0f71f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1888,6 +1888,7 @@ enum ieee80211_frame_release_type {
enum ieee80211_rate_control_changed {
IEEE80211_RC_BW_CHANGED = BIT(0),
IEEE80211_RC_SMPS_CHANGED = BIT(1),
+ IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2),
};

/**
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 37e71a3..590cf19 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -467,8 +467,11 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
}
}

- if (sta && rates_updated)
+ if (sta && rates_updated) {
+ drv_sta_rc_update(&local->hw, &sdata->vif, &sta->sta,
+ IEEE80211_RC_SUPP_RATES_CHANGED);
rate_control_rate_init(sta);
+ }

rcu_read_unlock();
}
--
1.7.9.4



2012-08-20 11:33:02

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: add supported rates change notification in IBSS

On Sun, 2012-08-12 at 18:24 +0200, Antonio Quartulli wrote:
> In IBSS it is possible that the supported rates set for a station changes over
> time (e.g. it gets first initialised as an empty set because of no available
> information about rates and updated later). In this case the driver has to be
> notified about the change in order to update its internal table accordingly (if
> needed).
>
> This behaviour is needed by all those drivers that handle rc internally but
> leave stations management to mac80211

Applied ... with a bunch of fixes

johannes