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

Commit f68d776a authored by Thomas Pedersen's avatar Thomas Pedersen Committed by Johannes Berg
Browse files

mac80211: support mesh rate updates



An existing mesh station entry may change its rate
capabilities, so call rate_control_rate_update() to notify
the rate control.

Signed-off-by: default avatarThomas Pedersen <thomas@cozybit.com>
[fix compilation]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 296fcba3
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -569,7 +569,8 @@ static inline void drv_sta_rc_update(struct ieee80211_local *local,
	check_sdata_in_driver(sdata);
	check_sdata_in_driver(sdata);


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


	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)
+7 −1
Original line number Original line Diff line number Diff line
@@ -292,7 +292,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
	struct ieee80211_local *local = sdata->local;
	struct ieee80211_local *local = sdata->local;
	enum ieee80211_band band = ieee80211_get_sdata_band(sdata);
	enum ieee80211_band band = ieee80211_get_sdata_band(sdata);
	struct ieee80211_supported_band *sband;
	struct ieee80211_supported_band *sband;
	u32 rates, basic_rates = 0;
	u32 rates, basic_rates = 0, changed = 0;


	sband = local->hw.wiphy->bands[band];
	sband = local->hw.wiphy->bands[band];
	rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates);
	rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates);
@@ -304,6 +304,8 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
	if (sta->plink_state == NL80211_PLINK_ESTAB)
	if (sta->plink_state == NL80211_PLINK_ESTAB)
		goto out;
		goto out;


	if (sta->sta.supp_rates[band] != rates)
		changed |= IEEE80211_RC_SUPP_RATES_CHANGED;
	sta->sta.supp_rates[band] = rates;
	sta->sta.supp_rates[band] = rates;
	if (elems->ht_cap_elem &&
	if (elems->ht_cap_elem &&
	    sdata->vif.bss_conf.chandef.width != NL80211_CHAN_WIDTH_20_NOHT)
	    sdata->vif.bss_conf.chandef.width != NL80211_CHAN_WIDTH_20_NOHT)
@@ -322,11 +324,15 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
					    ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
					    ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
		ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan,
		ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan,
					     elems->ht_operation, &chandef);
					     elems->ht_operation, &chandef);
		if (sta->ch_width != chandef.width)
			changed |= IEEE80211_RC_BW_CHANGED;
		sta->ch_width = chandef.width;
		sta->ch_width = chandef.width;
	}
	}


	if (insert)
	if (insert)
		rate_control_rate_init(sta);
		rate_control_rate_init(sta);
	else
		rate_control_rate_update(local, sband, sta, changed);
out:
out:
	spin_unlock_bh(&sta->lock);
	spin_unlock_bh(&sta->lock);
}
}