Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e687f61e authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Johannes Berg
Browse files

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: default avatarGui Iribarren <gui@altermundi.net>
Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
[Johannes - add docs, validate IBSS mode only, fix compilation]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 4bd4c2dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1897,10 +1897,14 @@ enum ieee80211_frame_release_type {
 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit
 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit
 *	to this station changed.
 *	to this station changed.
 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed.
 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed.
 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer
 *	changed (in IBSS mode) due to discovering more information about
 *	the peer.
 */
 */
enum ieee80211_rate_control_changed {
enum ieee80211_rate_control_changed {
	IEEE80211_RC_BW_CHANGED		= BIT(0),
	IEEE80211_RC_BW_CHANGED		= BIT(0),
	IEEE80211_RC_SMPS_CHANGED	= BIT(1),
	IEEE80211_RC_SMPS_CHANGED	= BIT(1),
	IEEE80211_RC_SUPP_RATES_CHANGED	= BIT(2),
};
};


/**
/**
+3 −0
Original line number Original line Diff line number Diff line
@@ -528,6 +528,9 @@ static inline void drv_sta_rc_update(struct ieee80211_local *local,
	sdata = get_bss_sdata(sdata);
	sdata = get_bss_sdata(sdata);
	check_sdata_in_driver(sdata);
	check_sdata_in_driver(sdata);


	WARN_ON(changed & IEEE80211_RC_SUPP_RATES_CHANGED &&
		sdata->vif.type != NL80211_IFTYPE_ADHOC);

	trace_drv_sta_rc_update(local, sdata, sta, changed);
	trace_drv_sta_rc_update(local, sdata, sta, changed);
	if (local->ops->sta_rc_update)
	if (local->ops->sta_rc_update)
		local->ops->sta_rc_update(&local->hw, &sdata->vif,
		local->ops->sta_rc_update(&local->hw, &sdata->vif,
+4 −1
Original line number Original line Diff line number Diff line
@@ -459,8 +459,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, sdata, &sta->sta,
					  IEEE80211_RC_SUPP_RATES_CHANGED);
			rate_control_rate_init(sta);
			rate_control_rate_init(sta);
		}


		rcu_read_unlock();
		rcu_read_unlock();
	}
	}