Commit 64f68e5d authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: remove channel type argument from rate_update



The channel type argument to the rate_update()
callback isn't really the correct way to give
the rate control algorithm about the desired
RX bandwidth of the peer.

Remove this argument, and instead update the
STA capabilities with 20/40 appropriately. The
SMPS update done by this callback works in the
same way, so this makes the callback cleaner.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 24398e39
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1436,7 +1436,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,

static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
			    struct ieee80211_sta *sta, void *priv_sta,
			    u32 changed, enum nl80211_channel_type oper_chan_type)
			    u32 changed)
{
	struct ath_softc *sc = priv;
	struct ath_rate_priv *ath_rc_priv = priv_sta;
@@ -1451,8 +1451,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
		if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION)
			return;

		if (oper_chan_type == NL80211_CHAN_HT40MINUS ||
		    oper_chan_type == NL80211_CHAN_HT40PLUS)
		if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
			oper_cw40 = true;

		if (oper_cw40)
+1 −2
Original line number Diff line number Diff line
@@ -225,8 +225,7 @@ static void rtl_rate_init(void *ppriv,
static void rtl_rate_update(void *ppriv,
			    struct ieee80211_supported_band *sband,
			    struct ieee80211_sta *sta, void *priv_sta,
			    u32 changed,
			    enum nl80211_channel_type oper_chan_type)
			    u32 changed)
{
}

+2 −3
Original line number Diff line number Diff line
@@ -3569,9 +3569,8 @@ struct rate_control_ops {
	void (*rate_init)(void *priv, struct ieee80211_supported_band *sband,
			  struct ieee80211_sta *sta, void *priv_sta);
	void (*rate_update)(void *priv, struct ieee80211_supported_band *sband,
			    struct ieee80211_sta *sta,
			    void *priv_sta, u32 changed,
			    enum nl80211_channel_type oper_chan_type);
			    struct ieee80211_sta *sta, void *priv_sta,
			    u32 changed);
	void (*free_sta)(void *priv, struct ieee80211_sta *sta,
			 void *priv_sta);

+0 −26
Original line number Diff line number Diff line
@@ -135,29 +135,3 @@ bool ieee80211_set_channel_type(struct ieee80211_local *local,

	return result;
}

/*
 * ieee80211_get_tx_channel_type returns the channel type we should
 * use for packet transmission, given the channel capability and
 * whatever regulatory flags we have been given.
 */
enum nl80211_channel_type ieee80211_get_tx_channel_type(
				struct ieee80211_local *local,
				enum nl80211_channel_type channel_type)
{
	switch (channel_type) {
	case NL80211_CHAN_HT40PLUS:
		if (local->hw.conf.channel->flags &
				IEEE80211_CHAN_NO_HT40PLUS)
			return NL80211_CHAN_HT20;
		break;
	case NL80211_CHAN_HT40MINUS:
		if (local->hw.conf.channel->flags &
				IEEE80211_CHAN_NO_HT40MINUS)
			return NL80211_CHAN_HT20;
		break;
	default:
		break;
	}
	return channel_type;
}
+0 −5
Original line number Diff line number Diff line
@@ -512,8 +512,6 @@ struct ieee80211_if_managed {
	int rssi_min_thold, rssi_max_thold;
	int last_ave_beacon_signal;

	enum nl80211_channel_type tx_chantype;

	struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
	struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
};
@@ -1501,9 +1499,6 @@ bool ieee80211_set_channel_type(struct ieee80211_local *local,
				enum nl80211_channel_type chantype);
enum nl80211_channel_type
ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper);
enum nl80211_channel_type ieee80211_get_tx_channel_type(
					struct ieee80211_local *local,
					enum nl80211_channel_type channel_type);

#ifdef CONFIG_MAC80211_NOINLINE
#define debug_noinline noinline
Loading