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

Commit 323ce79a authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: share sta->supp_rates



As more preparation for a saner rate control algorithm API,
share the supported rates bitmap in the public API.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b7e35008
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1825,7 +1825,7 @@ static void ath_setup_rates(struct ieee80211_local *local, struct sta_info *sta)


	sband =  local->hw.wiphy->bands[local->hw.conf.channel->band];
	sband =  local->hw.wiphy->bands[local->hw.conf.channel->band];
	for (i = 0; i < sband->n_bitrates; i++) {
	for (i = 0; i < sband->n_bitrates; i++) {
		if (sta->supp_rates[local->hw.conf.channel->band] & BIT(i)) {
		if (sta->sta.supp_rates[local->hw.conf.channel->band] & BIT(i)) {
			rc_priv->neg_rates.rs_rates[j]
			rc_priv->neg_rates.rs_rates[j]
				= (sband->bitrates[i].bitrate * 2) / 10;
				= (sband->bitrates[i].bitrate * 2) / 10;
			j++;
			j++;
+2 −2
Original line number Original line Diff line number Diff line
@@ -333,7 +333,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
	 * after assoc.. */
	 * after assoc.. */


	for (i = IWL_RATE_COUNT - 1; i >= 0; i--) {
	for (i = IWL_RATE_COUNT - 1; i >= 0; i--) {
		if (sta->supp_rates[local->hw.conf.channel->band] & (1 << i)) {
		if (sta->sta.supp_rates[local->hw.conf.channel->band] & (1 << i)) {
			sta->txrate_idx = i;
			sta->txrate_idx = i;
			break;
			break;
		}
		}
@@ -680,7 +680,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,


	rs_sta = (void *)sta->rate_ctrl_priv;
	rs_sta = (void *)sta->rate_ctrl_priv;


	rate_mask = sta->supp_rates[sband->band];
	rate_mask = sta->sta.supp_rates[sband->band];
	index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1);
	index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1);


	if (sband->band == IEEE80211_BAND_5GHZ)
	if (sband->band == IEEE80211_BAND_5GHZ)
+3 −3
Original line number Original line Diff line number Diff line
@@ -1731,7 +1731,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
		return;
		return;


	lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv;
	lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv;
	lq_sta->supp_rates = sta->supp_rates[lq_sta->band];
	lq_sta->supp_rates = sta->sta.supp_rates[lq_sta->band];


	tid = rs_tl_add_packet(lq_sta, hdr);
	tid = rs_tl_add_packet(lq_sta, hdr);


@@ -2233,7 +2233,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];


	lq_sta->flush_timer = 0;
	lq_sta->flush_timer = 0;
	lq_sta->supp_rates = sta->supp_rates[sband->band];
	lq_sta->supp_rates = sta->sta.supp_rates[sband->band];
	sta->txrate_idx = 3;
	sta->txrate_idx = 3;
	for (j = 0; j < LQ_SIZE; j++)
	for (j = 0; j < LQ_SIZE; j++)
		for (i = 0; i < IWL_RATE_COUNT; i++)
		for (i = 0; i < IWL_RATE_COUNT; i++)
@@ -2270,7 +2270,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,


	/* Find highest tx rate supported by hardware and destination station */
	/* Find highest tx rate supported by hardware and destination station */
	for (i = 0; i < sband->n_bitrates; i++)
	for (i = 0; i < sband->n_bitrates; i++)
		if (sta->supp_rates[sband->band] & BIT(i))
		if (sta->sta.supp_rates[sband->band] & BIT(i))
			sta->txrate_idx = i;
			sta->txrate_idx = i;


	lq_sta->last_txrate_idx = sta->txrate_idx;
	lq_sta->last_txrate_idx = sta->txrate_idx;
+2 −0
Original line number Original line Diff line number Diff line
@@ -666,10 +666,12 @@ enum set_key_cmd {
 *
 *
 * @addr: MAC address
 * @addr: MAC address
 * @aid: AID we assigned to the station if we're an AP
 * @aid: AID we assigned to the station if we're an AP
 * @supp_rates: Bitmap of supported rates (per band)
 * @drv_priv: data area for driver use, will always be aligned to
 * @drv_priv: data area for driver use, will always be aligned to
 *	sizeof(void *), size is determined in hw information.
 *	sizeof(void *), size is determined in hw information.
 */
 */
struct ieee80211_sta {
struct ieee80211_sta {
	u64 supp_rates[IEEE80211_NUM_BANDS];
	u8 addr[ETH_ALEN];
	u8 addr[ETH_ALEN];
	u16 aid;
	u16 aid;


+1 −1
Original line number Original line Diff line number Diff line
@@ -667,7 +667,7 @@ static void sta_apply_parameters(struct ieee80211_local *local,
					rates |= BIT(j);
					rates |= BIT(j);
			}
			}
		}
		}
		sta->supp_rates[local->oper_channel->band] = rates;
		sta->sta.supp_rates[local->oper_channel->band] = rates;
	}
	}


	if (params->ht_capa) {
	if (params->ht_capa) {
Loading