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

Commit 3706de6f authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k: Maintain rate table choice after association



A scan run after association would change sc_curmode which is
used to get the current rate table. This patch fixes it
by removing sc_curmode and setting the rate table in usage in cur_rate_table
on association.

Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 40990ec0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
	 * XXX everything at min xmit rate
	 */
	rix = 0;
	rt = sc->hw_rate_table[sc->sc_curmode];
	rt = sc->cur_rate_table;
	rate = rt->info[rix].ratecode;
	if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
		rate |= rt->info[rix].short_preamble;
+0 −1
Original line number Diff line number Diff line
@@ -646,7 +646,6 @@ struct ath_softc {
	u8 sc_tx_chainmask;
	u8 sc_rx_chainmask;
	enum ath9k_int sc_imask;
	enum wireless_mode sc_curmode;
	enum PROT_MODE sc_protmode;

	u8 sc_nbcnvaps;
+2 −1
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ static void bus_read_cachesize(struct ath_softc *sc, int *csz)

static void ath_setcurmode(struct ath_softc *sc, enum wireless_mode mode)
{
	sc->sc_curmode = mode;
	if (!sc->sc_curaid)
		sc->cur_rate_table = sc->hw_rate_table[mode];
	/*
	 * All protection frames are transmited at 2Mb/s for
	 * 11g, otherwise at 1Mb/s.
+4 −5
Original line number Diff line number Diff line
@@ -874,9 +874,8 @@ static void ath_rc_ratefind(struct ath_softc *sc,
	 * So, set fourth rate in series to be same as third one for
	 * above conditions.
	 */
	if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) ||
	    (sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) ||
	    (sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) {
	if ((sc->hw->conf.channel->band == IEEE80211_BAND_2GHZ) &&
	    (sc->hw->conf.ht.enabled)) {
		u8 dot11rate = rate_table->info[rix].dot11rate;
		u8 phy = rate_table->info[rix].phy;
		if (i == 4 &&
@@ -1354,8 +1353,8 @@ static void ath_rc_init(struct ath_softc *sc,
						   sta->ht_cap.ht_supported,
						   is_cw_40);
	} else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
		/* sc_curmode would be set on init through config() */
		rate_table = sc->hw_rate_table[sc->sc_curmode];
		/* cur_rate_table would be set on init through config() */
		rate_table = sc->cur_rate_table;
	}

	if (!rate_table) {
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
			  struct ieee80211_rx_status *rx_status, bool *decrypt_error,
			  struct ath_softc *sc)
{
	struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode];
	struct ath_rate_table *rate_table = sc->cur_rate_table;
	struct ieee80211_hdr *hdr;
	int ratekbps, rix;
	u8 ratecode;
Loading