diff mbox

mac80211: add supported rates change notification in IBSS

Message ID 1344788695-1458-1-git-send-email-ordex@autistici.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Antonio Quartulli Aug. 12, 2012, 4:24 p.m. UTC
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 <gui@altermundi.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 include/net/mac80211.h |    1 +
 net/mac80211/ibss.c    |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Johannes Berg Aug. 20, 2012, 11:32 a.m. UTC | #1
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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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();
 	}