for (i = IWL_RATE_COUNT - 1; i >= 0; i--) {
                if (sta->sta.supp_rates[local->hw.conf.channel->band] & (1 << i)) {
-                       sta->txrate_idx = i;
+                       rs_sta->last_txrate_idx = i;
                        break;
                }
        }
 
-       rs_sta->last_txrate_idx = sta->txrate_idx;
-
        /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */
        if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ)
                rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
 
        rs_sta->last_txrate_idx = index;
        if (sband->band == IEEE80211_BAND_5GHZ)
-               sta->txrate_idx = rs_sta->last_txrate_idx - IWL_FIRST_OFDM_RATE;
+               sel->rate_idx = rs_sta->last_txrate_idx - IWL_FIRST_OFDM_RATE;
        else
-               sta->txrate_idx = rs_sta->last_txrate_idx;
+               sel->rate_idx = rs_sta->last_txrate_idx;
 
        rcu_read_unlock();
 
        IWL_DEBUG_RATE("leave: %d\n", index);
-
-       sel->rate_idx = sta->txrate_idx;
 }
 
 static struct rate_control_ops rs_ops = {
 
        i = index;
        lq_sta->last_txrate_idx = i;
 
-       /* sta->txrate_idx is an index to A mode rates which start
-        * at IWL_FIRST_OFDM_RATE
-        */
-       if (lq_sta->band == IEEE80211_BAND_5GHZ)
-               sta->txrate_idx = i - IWL_FIRST_OFDM_RATE;
-       else
-               sta->txrate_idx = i;
-
        return;
 }
 
 
        lq_sta->flush_timer = 0;
        lq_sta->supp_rates = sta->sta.supp_rates[sband->band];
-       sta->txrate_idx = 3;
        for (j = 0; j < LQ_SIZE; j++)
                for (i = 0; i < IWL_RATE_COUNT; i++)
                        rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
        }
 
        /* Find highest tx rate supported by hardware and destination station */
+       lq_sta->last_txrate_idx = 3;
        for (i = 0; i < sband->n_bitrates; i++)
                if (sta->sta.supp_rates[sband->band] & BIT(i))
-                       sta->txrate_idx = i;
+                       lq_sta->last_txrate_idx = i;
 
-       lq_sta->last_txrate_idx = sta->txrate_idx;
        /* For MODE_IEEE80211A, skip over cck rates in global rate table */
        if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ)
                lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
 
        struct ieee80211_sub_if_data *sdata;
        struct ieee80211_supported_band *sband;
        int cur_sorted, new_sorted, probe, tmp, n_bitrates, band;
-       int cur = sta->txrate_idx;
+       struct rc_pid_sta_info *spinfo = (void *)sta->rate_ctrl_priv;
+       int cur = spinfo->txrate_idx;
 
        sdata = sta->sdata;
        sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
        /* Fit the rate found to the nearest supported rate. */
        do {
                if (rate_supported(sta, band, rinfo[tmp].index)) {
-                       sta->txrate_idx = rinfo[tmp].index;
+                       spinfo->txrate_idx = rinfo[tmp].index;
                        break;
                }
                if (adj < 0)
        } while (tmp < n_bitrates && tmp >= 0);
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-       rate_control_pid_event_rate_change(
-               &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events,
-               sta->txrate_idx, sband->bitrates[sta->txrate_idx].bitrate);
+       rate_control_pid_event_rate_change(&spinfo->events,
+               spinfo->txrate_idx,
+               sband->bitrates[spinfo->txrate_idx].bitrate);
 #endif
 }
 
        spinfo->tx_num_failed = 0;
 
        /* If we just switched rate, update the rate behaviour info. */
-       if (pinfo->oldrate != sta->txrate_idx) {
+       if (pinfo->oldrate != spinfo->txrate_idx) {
 
                i = rinfo[pinfo->oldrate].rev_index;
-               j = rinfo[sta->txrate_idx].rev_index;
+               j = rinfo[spinfo->txrate_idx].rev_index;
 
                tmp = (pf - spinfo->last_pf);
                tmp = RC_PID_DO_ARITH_RIGHT_SHIFT(tmp, RC_PID_ARITH_SHIFT);
 
                rinfo[j].diff = rinfo[i].diff + tmp;
-               pinfo->oldrate = sta->txrate_idx;
+               pinfo->oldrate = spinfo->txrate_idx;
        }
        rate_control_pid_normalize(pinfo, sband->n_bitrates);
 
        if (!sta)
                goto unlock;
 
+       spinfo = sta->rate_ctrl_priv;
+
        /* Don't update the state if we're not controlling the rate. */
        sdata = sta->sdata;
        if (sdata->force_unicast_rateidx > -1) {
-               sta->txrate_idx = sdata->max_ratectrl_rateidx;
+               spinfo->txrate_idx = sdata->max_ratectrl_rateidx;
                goto unlock;
        }
 
        /* Ignore all frames that were sent with a different rate than the rate
         * we currently advise mac80211 to use. */
-       if (info->tx_rate_idx != sta->txrate_idx)
+       if (info->tx_rate_idx != spinfo->txrate_idx)
                goto unlock;
 
-       spinfo = sta->rate_ctrl_priv;
        spinfo->tx_num_xmit++;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
        struct ieee80211_sub_if_data *sdata;
+       struct rc_pid_sta_info *spinfo;
        struct sta_info *sta;
        int rateidx;
        u16 fc;
 
        /* If a forced rate is in effect, select it. */
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+       spinfo = (struct rc_pid_sta_info *)sta->rate_ctrl_priv;
        if (sdata->force_unicast_rateidx > -1)
-               sta->txrate_idx = sdata->force_unicast_rateidx;
+               spinfo->txrate_idx = sdata->force_unicast_rateidx;
 
-       rateidx = sta->txrate_idx;
+       rateidx = spinfo->txrate_idx;
 
        if (rateidx >= sband->n_bitrates)
                rateidx = sband->n_bitrates - 1;
         * Until that method is implemented, we will use the lowest supported
         * rate as a workaround. */
        struct ieee80211_supported_band *sband;
+       struct rc_pid_sta_info *spinfo = (void *)sta->rate_ctrl_priv;
 
        sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
-       sta->txrate_idx = rate_lowest_index(local, sband, sta);
+       spinfo->txrate_idx = rate_lowest_index(local, sband, sta);
        sta->fail_avg = 0;
 }