ath9k: fix bisectability of rc patches
[openwrt.git] / package / mac80211 / patches / 530-ath9k_cleanup.patch
index 49a1143..ab205d5 100644 (file)
@@ -52,7 +52,7 @@
 -      struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info);
  
 -      if (tx_info_priv && tx_info_priv->frame_type == ATH9K_INT_PAUSE &&
-+      if ((tx_info->driver_flags & ATH_TX_INFO_FRAME_TYPE_PAUSE) &&
++      if ((tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_PAUSE) &&
            aphy->state == ATH_WIPHY_PAUSING) {
 -              if (!(info->flags & IEEE80211_TX_STAT_ACK)) {
 +              if (!(tx_info->flags & IEEE80211_TX_STAT_ACK)) {
 -      tx_info->rate_driver_data[0] = tx_info_priv;
 -      tx_info_priv->aphy = aphy;
 -      tx_info_priv->frame_type = txctl->frame_type;
-+      tx_info->driver_flags = 0;
++      tx_info->pad[0] = 0;
 +      switch (txctl->frame_type) {
 +      case ATH9K_NOT_INTERNAL:
 +              break;
 +      case ATH9K_INT_PAUSE:
-+              tx_info->driver_flags |= ATH_TX_INFO_FRAME_TYPE_PAUSE;
++              tx_info->pad[0] |= ATH_TX_INFO_FRAME_TYPE_PAUSE;
 +              /* fall through */
 +      case ATH9K_INT_UNPAUSE:
-+              tx_info->driver_flags |= ATH_TX_INFO_FRAME_TYPE_INTERNAL;
++              tx_info->pad[0] |= ATH_TX_INFO_FRAME_TYPE_INTERNAL;
 +              break;
 +      }
        hdrlen = ieee80211_get_hdrlen_from_skb(skb);
 -      if (frame_type == ATH9K_NOT_INTERNAL)
 -              ieee80211_tx_status(hw, skb);
 -      else
-+      if (unlikely(tx_info->driver_flags & ATH_TX_INFO_FRAME_TYPE_INTERNAL))
++      if (unlikely(tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_INTERNAL))
                ath9k_tx_status(hw, skb);
 +      else
 +              ieee80211_tx_status(hw, skb);
  
 -      tx_info_priv->update_rc = update_rc;
 +      if (update_rc)
-+              tx_info->driver_flags |= ATH_TX_INFO_UPDATE_RC;
++              tx_info->pad[0] |= ATH_TX_INFO_UPDATE_RC;
        if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT)
                tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
  
 -                      tx_info_priv->n_bad_frames = nbad;
 +                      if (ds->ds_txstat.ts_flags &
 +                          (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN))
-+                              tx_info->driver_flags |= ATH_TX_INFO_UNDERRUN;
++                              tx_info->pad[0] |= ATH_TX_INFO_UNDERRUN;
 +                      if ((ds->ds_txstat.ts_status & ATH9K_TXERR_XRETRY) ||
 +                          (ds->ds_txstat.ts_status & ATH9K_TXERR_FIFO))
-+                              tx_info->driver_flags |= ATH_TX_INFO_XRETRY;
-+                      tx_info->ampdu_len = bf->bf_nframes;
++                              tx_info->pad[0] |= ATH_TX_INFO_XRETRY;
++                      tx_info->status.ampdu_len = bf->bf_nframes;
 +                      tx_info->status.ampdu_ack_len = bf->bf_nframes - nbad;
                }
        }
        };
  
        last_per = ath_rc_priv->per[tx_rate];
-+      n_bad_frames = tx_info->ampdu_len - tx_info->status.ampdu_ack_len;
++      n_bad_frames = tx_info->status.ampdu_len - tx_info->status.ampdu_ack_len;
  
        if (xretries) {
                if (xretries == 1) {
                         */
 -                      if (tx_info_priv->n_frames > 0) {
 -                              int n_frames, n_bad_frames;
-+                      if (tx_info->ampdu_len > 0) {
++                      if (tx_info->status.ampdu_len > 0) {
 +                              int n_frames, n_bad_tries;
                                u8 cur_per, new_per;
  
 -                                      tx_info_priv->n_bad_frames;
 -                              n_frames = tx_info_priv->n_frames * (retries + 1);
 -                              cur_per = (100 * n_bad_frames / n_frames) >> 3;
-+                              n_bad_tries = retries * tx_info->ampdu_len +
++                              n_bad_tries = retries * tx_info->status.ampdu_len +
 +                                      n_bad_frames;
-+                              n_frames = tx_info->ampdu_len * (retries + 1);
++                              n_frames = tx_info->status.ampdu_len * (retries + 1);
 +                              cur_per = (100 * n_bad_tries / n_frames) >> 3;
                                new_per = (u8)(last_per - (last_per >> 3) + cur_per);
                                ath_rc_priv->per[tx_rate] = new_per;
                if (ath_rc_priv->probe_rate && ath_rc_priv->probe_rate == tx_rate) {
 -                      if (retries > 0 || 2 * tx_info_priv->n_bad_frames >
 -                              tx_info_priv->n_frames) {
-+                      if (retries > 0 || 2 * n_bad_frames > tx_info->ampdu_len) {
++                      if (retries > 0 || 2 * n_bad_frames > tx_info->status.ampdu_len) {
                                /*
                                 * Since we probed with just a single attempt,
                                 * any retries means the probe failed.  Also,
        if (!priv_sta || !ieee80211_is_data(fc) ||
 -          !tx_info_priv->update_rc)
 -              goto exit;
-+          !(tx_info->driver_flags & ATH_TX_INFO_UPDATE_RC))
++          !(tx_info->pad[0] & ATH_TX_INFO_UPDATE_RC))
 +              return;
  
 -      if (tx_info_priv->tx.ts_status & ATH9K_TXERR_FILT)
 -      if (tx_info_priv->tx.ts_flags &
 -          (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN) &&
 -          ((sc->sc_ah->tx_trig_level) >= ath_rc_priv->tx_triglevel_max)) {
-+      if ((tx_info->driver_flags & ATH_TX_INFO_UNDERRUN) &&
++      if ((tx_info->pad[0] & ATH_TX_INFO_UNDERRUN) &&
 +          (sc->sc_ah->tx_trig_level >= ath_rc_priv->tx_triglevel_max)) {
                tx_status = 1;
                is_underrun = 1;
  
 -      if ((tx_info_priv->tx.ts_status & ATH9K_TXERR_XRETRY) ||
 -          (tx_info_priv->tx.ts_status & ATH9K_TXERR_FIFO))
-+      if (tx_info->driver_flags & ATH_TX_INFO_XRETRY)
++      if (tx_info->pad[0] & ATH_TX_INFO_XRETRY)
                tx_status = 1;
  
        ath_rc_tx_status(sc, ath_rc_priv, tx_info, final_ts_idx, tx_status,
This page took 0.031147 seconds and 4 git commands to generate.