firewall: update to git head
[openwrt.git] / package / mac80211 / patches / 300-pending_work.patch
index 2ad4828..9426b09 100644 (file)
        u32 txq_max_pending[IEEE80211_NUM_ACS];
        u16 max_aggr_framelen[IEEE80211_NUM_ACS][4][32];
  };
-@@ -356,6 +354,11 @@ void ath_tx_aggr_resume(struct ath_softc
+@@ -346,6 +344,8 @@ int ath_txq_update(struct ath_softc *sc,
+ void ath_update_max_aggr_framelen(struct ath_softc *sc, int queue, int txop);
+ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
+                struct ath_tx_control *txctl);
++void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
++               struct sk_buff *skb);
+ void ath_tx_tasklet(struct ath_softc *sc);
+ void ath_tx_edma_tasklet(struct ath_softc *sc);
+ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
+@@ -356,6 +356,11 @@ void ath_tx_aggr_resume(struct ath_softc
  void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
  void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
                       struct ath_node *an);
  
  /********/
  /* VIFs */
-@@ -410,6 +413,7 @@ struct ath_beacon {
-       struct ath_descdma bdma;
-       struct ath_txq *cabq;
-       struct list_head bbuf;
-+      int cabq_dur;
-       bool tx_processed;
-       bool tx_last;
-@@ -658,11 +662,10 @@ enum sc_op_flags {
+@@ -658,11 +663,10 @@ enum sc_op_flags {
  struct ath_rate_table;
  
  struct ath9k_vif_iter_data {
   * @ssid_len: Length of SSID given in @ssid.
   * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
   * @txpower: TX power in dBm
-@@ -562,6 +562,9 @@ enum mac80211_rate_control_flags {
+@@ -459,6 +459,8 @@ struct ieee80211_bss_conf {
+  * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
+  *    would be fragmented by size (this is optional, only used for
+  *    monitor injection).
++ * @IEEE80211_TX_CTL_PS_RESPONSE: This frame is a response to a poll
++ *    frame (PS-Poll or uAPSD).
+  *
+  * Note: If you have to add new flags to the enumeration, then don't
+  *     forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
+@@ -494,6 +496,7 @@ enum mac80211_tx_control_flags {
+       IEEE80211_TX_STATUS_EOSP                = BIT(28),
+       IEEE80211_TX_CTL_USE_MINRATE            = BIT(29),
+       IEEE80211_TX_CTL_DONTFRAG               = BIT(30),
++      IEEE80211_TX_CTL_PS_RESPONSE            = BIT(31),
+ };
+ #define IEEE80211_TX_CTL_STBC_SHIFT           23
+@@ -562,6 +565,9 @@ enum mac80211_rate_control_flags {
  /* maximum number of rate stages */
  #define IEEE80211_TX_MAX_RATES        4
  
  /**
   * struct ieee80211_tx_rate - rate selection/status
   *
-@@ -602,8 +605,8 @@ static inline void ieee80211_rate_set_vh
+@@ -602,8 +608,8 @@ static inline void ieee80211_rate_set_vh
                                          u8 mcs, u8 nss)
  {
        WARN_ON(mcs & ~0xF);
  }
  
  static inline u8
-@@ -615,7 +618,7 @@ ieee80211_rate_get_vht_mcs(const struct 
+@@ -615,7 +621,7 @@ ieee80211_rate_get_vht_mcs(const struct 
  static inline u8
  ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate)
  {
  }
  
  /**
-@@ -656,7 +659,11 @@ struct ieee80211_tx_info {
+@@ -656,7 +662,11 @@ struct ieee80211_tx_info {
                                        struct ieee80211_tx_rate rates[
                                                IEEE80211_TX_MAX_RATES];
                                        s8 rts_cts_rate_idx;
                                };
                                /* only needed before rate control */
                                unsigned long jiffies;
-@@ -677,6 +684,8 @@ struct ieee80211_tx_info {
+@@ -677,6 +687,8 @@ struct ieee80211_tx_info {
                struct {
                        struct ieee80211_tx_rate driver_rates[
                                IEEE80211_TX_MAX_RATES];
                        void *rate_driver_data[
                                IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)];
                };
-@@ -840,6 +849,9 @@ enum mac80211_rx_flags {
+@@ -840,6 +852,9 @@ enum mac80211_rx_flags {
   * @signal: signal strength when receiving this frame, either in dBm, in dB or
   *    unspecified depending on the hardware capabilities flags
   *    @IEEE80211_HW_SIGNAL_*
   * @antenna: antenna used
   * @rate_idx: index of data rate into band's supported rates or MCS index if
   *    HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT)
-@@ -871,6 +883,8 @@ struct ieee80211_rx_status {
+@@ -871,6 +886,8 @@ struct ieee80211_rx_status {
        u8 band;
        u8 antenna;
        s8 signal;
        u8 ampdu_delimiter_crc;
        u8 vendor_radiotap_align;
        u8 vendor_radiotap_oui[3];
-@@ -1018,13 +1032,13 @@ struct ieee80211_conf {
+@@ -1018,13 +1035,13 @@ struct ieee80211_conf {
   *    the driver passed into mac80211.
   * @block_tx: Indicates whether transmission must be blocked before the
   *    scheduled channel switch, as indicated by the AP.
        u8 count;
  };
  
-@@ -1222,6 +1236,24 @@ enum ieee80211_sta_rx_bandwidth {
+@@ -1222,6 +1239,24 @@ enum ieee80211_sta_rx_bandwidth {
  };
  
  /**
   * struct ieee80211_sta - station table entry
   *
   * A station table entry represents a station we are possibly
-@@ -1248,6 +1280,7 @@ enum ieee80211_sta_rx_bandwidth {
+@@ -1248,6 +1283,7 @@ enum ieee80211_sta_rx_bandwidth {
   *    notifications and capabilities. The value is only valid after
   *    the station moves to associated state.
   * @smps_mode: current SMPS mode (off, static or dynamic)
   */
  struct ieee80211_sta {
        u32 supp_rates[IEEE80211_NUM_BANDS];
-@@ -1261,6 +1294,7 @@ struct ieee80211_sta {
+@@ -1261,6 +1297,7 @@ struct ieee80211_sta {
        u8 rx_nss;
        enum ieee80211_sta_rx_bandwidth bandwidth;
        enum ieee80211_smps_mode smps_mode;
  
        /* must be last */
        u8 drv_priv[0] __aligned(sizeof(void *));
-@@ -1416,6 +1450,9 @@ struct ieee80211_tx_control {
+@@ -1416,6 +1453,9 @@ struct ieee80211_tx_control {
   *    for different virtual interfaces. See the doc section on HW queue
   *    control for more details.
   *
   * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any
   *    P2P Interface. This will be honoured even if more than one interface
   *    is supported.
-@@ -1448,6 +1485,7 @@ enum ieee80211_hw_flags {
+@@ -1448,6 +1488,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_SUPPORTS_PER_STA_GTK               = 1<<21,
        IEEE80211_HW_AP_LINK_PS                         = 1<<22,
        IEEE80211_HW_TX_AMPDU_SETUP_IN_HW               = 1<<23,
        IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF              = 1<<25,
        IEEE80211_HW_TIMING_BEACON_ONLY                 = 1<<26,
  };
-@@ -3144,6 +3182,25 @@ void ieee80211_sta_set_buffered(struct i
+@@ -3144,6 +3185,25 @@ void ieee80211_sta_set_buffered(struct i
                                u8 tid, bool buffered);
  
  /**
   * ieee80211_tx_status - transmit status callback
   *
   * Call this function for all transmitted frames after they have been
-@@ -4118,7 +4175,7 @@ void ieee80211_send_bar(struct ieee80211
+@@ -4118,7 +4178,7 @@ void ieee80211_send_bar(struct ieee80211
   *    (deprecated; this will be removed once drivers get updated to use
   *    rate_idx_mask)
   * @rate_idx_mask: user-requested (legacy) rate mask
   * @bss: whether this frame is sent out in AP or IBSS mode
   */
  struct ieee80211_tx_rate_control {
-@@ -4130,7 +4187,7 @@ struct ieee80211_tx_rate_control {
+@@ -4130,7 +4190,7 @@ struct ieee80211_tx_rate_control {
        bool rts, short_preamble;
        u8 max_rate_idx;
        u32 rate_idx_mask;
        bool bss;
  };
  
-@@ -4219,6 +4276,22 @@ bool rate_usable_index_exists(struct iee
+@@ -4219,6 +4279,22 @@ bool rate_usable_index_exists(struct iee
        return false;
  }
  
  
        if (sta_prepare_rate_control(local, sta, gfp)) {
                kfree(sta);
+@@ -1130,6 +1132,7 @@ static void ieee80211_send_null_response
+        * ends the poll/service period.
+        */
+       info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |
++                     IEEE80211_TX_CTL_PS_RESPONSE |
+                      IEEE80211_TX_STATUS_EOSP |
+                      IEEE80211_TX_CTL_REQ_TX_STATUS;
+@@ -1267,7 +1270,8 @@ ieee80211_sta_ps_deliver_response(struct
+                        * STA may still remain is PS mode after this frame
+                        * exchange.
+                        */
+-                      info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
++                      info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |
++                                     IEEE80211_TX_CTL_PS_RESPONSE;
+                       /*
+                        * Use MoreData flag to indicate whether there are
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
 @@ -2270,6 +2270,7 @@ static const struct nla_policy mntr_flag
                bool is_40, is_sgi, is_sp;
                int phy;
  
-@@ -1107,9 +1122,8 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1106,10 +1121,8 @@ static void ath_tx_fill_desc(struct ath_
+                            struct ath_txq *txq, int len)
  {
        struct ath_hw *ah = sc->sc_ah;
-       struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
+-      struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
 -      struct ath_buf *bf_first = bf;
 +      struct ath_buf *bf_first = NULL;
        struct ath_tx_info info;
  
        memset(&info, 0, sizeof(info));
        info.is_first = true;
-@@ -1117,24 +1131,17 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1117,24 +1130,11 @@ static void ath_tx_fill_desc(struct ath_
        info.txpower = MAX_RATE_POWER;
        info.qcu = txq->axq_qnum;
  
 -      ath_buf_set_rate(sc, bf, &info, len);
 -
 -      if (tx_info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
-+      if ((tx_info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) ||
-+          txq == sc->tx.uapsdq)
-               info.flags |= ATH9K_TXDESC_CLRDMASK;
-       if (bf->bf_state.bfs_paprd)
-               info.flags |= (u32) bf->bf_state.bfs_paprd << ATH9K_TXDESC_PAPRD_S;
+-              info.flags |= ATH9K_TXDESC_CLRDMASK;
+-
+-      if (bf->bf_state.bfs_paprd)
+-              info.flags |= (u32) bf->bf_state.bfs_paprd << ATH9K_TXDESC_PAPRD_S;
+-
 -
        while (bf) {
                struct sk_buff *skb = bf->bf_mpdu;
++              struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
                struct ath_frame_info *fi = get_frame_info(skb);
 +              bool aggr = !!(bf->bf_state.bf_type & BUF_AGGR);
  
                info.type = get_hw_packet_type(skb);
                if (bf->bf_next)
-@@ -1142,6 +1149,21 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1142,6 +1142,26 @@ static void ath_tx_fill_desc(struct ath_
                else
                        info.link = 0;
  
 +                      bf_first = bf;
 +
 +                      info.flags = ATH9K_TXDESC_INTREQ;
++                      if ((tx_info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) ||
++                          txq == sc->tx.uapsdq)
++                              info.flags |= ATH9K_TXDESC_CLRDMASK;
++
 +                      if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK)
 +                              info.flags |= ATH9K_TXDESC_NOACK;
 +                      if (tx_info->flags & IEEE80211_TX_CTL_LDPC)
 +                              info.flags |= ATH9K_TXDESC_LDPC;
 +
-+                      ath_buf_set_rate(sc, bf, &info, len);
++                      if (bf->bf_state.bfs_paprd)
++                              info.flags |= (u32) bf->bf_state.bfs_paprd <<
++                                            ATH9K_TXDESC_PAPRD_S;
 +
-+                      if (txq == sc->beacon.cabq)
-+                              sc->beacon.cabq_dur += info.rates[0].PktDuration;
++                      ath_buf_set_rate(sc, bf, &info, len);
 +              }
 +
                info.buf_addr[0] = bf->bf_buf_addr;
                info.buf_len[0] = skb->len;
                info.pkt_len = fi->framelen;
-@@ -1151,7 +1173,7 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1151,7 +1171,7 @@ static void ath_tx_fill_desc(struct ath_
                if (aggr) {
                        if (bf == bf_first)
                                info.aggr = AGGR_BUF_FIRST;
                                info.aggr = AGGR_BUF_LAST;
                        else
                                info.aggr = AGGR_BUF_MIDDLE;
-@@ -1160,6 +1182,9 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1160,6 +1180,9 @@ static void ath_tx_fill_desc(struct ath_
                        info.aggr_len = len;
                }
  
                ath9k_hw_set_txdesc(ah, bf->bf_desc, &info);
                bf = bf->bf_next;
        }
-@@ -1224,9 +1249,6 @@ int ath_tx_aggr_start(struct ath_softc *
+@@ -1224,9 +1247,6 @@ int ath_tx_aggr_start(struct ath_softc *
        an = (struct ath_node *)sta->drv_priv;
        txtid = ATH_AN_2_TID(an, tid);
  
        /* update ampdu factor/density, they may have changed. This may happen
         * in HT IBSS when a beacon with HT-info is received after the station
         * has already been added.
-@@ -1238,7 +1260,7 @@ int ath_tx_aggr_start(struct ath_softc *
+@@ -1238,7 +1258,7 @@ int ath_tx_aggr_start(struct ath_softc *
                an->mpdudensity = density;
        }
  
        txtid->paused = true;
        *ssn = txtid->seq_start = txtid->seq_next;
        txtid->bar_index = -1;
-@@ -1255,28 +1277,9 @@ void ath_tx_aggr_stop(struct ath_softc *
+@@ -1255,28 +1275,9 @@ void ath_tx_aggr_stop(struct ath_softc *
        struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid);
        struct ath_txq *txq = txtid->ac->txq;
  
        ath_tx_flush_tid(sc, txtid);
        ath_txq_unlock_complete(sc, txq);
  }
-@@ -1342,18 +1345,92 @@ void ath_tx_aggr_wakeup(struct ath_softc
+@@ -1342,18 +1343,92 @@ void ath_tx_aggr_wakeup(struct ath_softc
        }
  }
  
  }
  
  /********************/
-@@ -1709,8 +1786,9 @@ static void ath_tx_txqaddbuf(struct ath_
+@@ -1709,8 +1784,9 @@ static void ath_tx_txqaddbuf(struct ath_
        }
  }
  
  {
        struct ath_frame_info *fi = get_frame_info(skb);
        struct list_head bf_head;
-@@ -1723,26 +1801,28 @@ static void ath_tx_send_ampdu(struct ath
+@@ -1723,26 +1799,28 @@ static void ath_tx_send_ampdu(struct ath
         * - seqno is not within block-ack window
         * - h/w queue depth exceeds low water mark
         */
        bf->bf_state.bf_type = BUF_AMPDU;
        INIT_LIST_HEAD(&bf_head);
        list_add(&bf->list, &bf_head);
-@@ -1751,10 +1831,10 @@ static void ath_tx_send_ampdu(struct ath
+@@ -1751,10 +1829,10 @@ static void ath_tx_send_ampdu(struct ath
        ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
  
        /* Queue to h/w without aggregation */
  }
  
  static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
-@@ -1892,49 +1972,6 @@ static struct ath_buf *ath_tx_setup_buff
+@@ -1892,62 +1970,16 @@ static struct ath_buf *ath_tx_setup_buff
        return bf;
  }
  
 -      }
 -}
 -
- /* Upon failure caller should free skb */
- int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
-                struct ath_tx_control *txctl)
-@@ -1945,8 +1982,11 @@ int ath_tx_start(struct ieee80211_hw *hw
+-/* Upon failure caller should free skb */
+-int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
+-               struct ath_tx_control *txctl)
++static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
++                        struct ath_tx_control *txctl)
+ {
+       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+       struct ieee80211_sta *sta = txctl->sta;
        struct ieee80211_vif *vif = info->control.vif;
        struct ath_softc *sc = hw->priv;
-       struct ath_txq *txq = txctl->txq;
-+      struct ath_atx_tid *tid = NULL;
-+      struct ath_buf *bf;
-       int padpos, padsize;
+-      struct ath_txq *txq = txctl->txq;
+-      int padpos, padsize;
        int frmlen = skb->len + FCS_LEN;
-+      u8 tidno;
-       int q;
+-      int q;
++      int padpos, padsize;
  
        /* NOTE:  sta can be NULL according to net/mac80211.h */
-@@ -2002,8 +2042,47 @@ int ath_tx_start(struct ieee80211_hw *hw
+       if (sta)
+@@ -1968,6 +2000,11 @@ int ath_tx_start(struct ieee80211_hw *hw
+               hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
+       }
++      if ((vif && vif->type != NL80211_IFTYPE_AP &&
++                  vif->type != NL80211_IFTYPE_AP_VLAN) ||
++          !ieee80211_is_data(hdr->frame_control))
++              info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
++
+       /* Add the padding after the header if this is not already done */
+       padpos = ieee80211_hdrlen(hdr->frame_control);
+       padsize = padpos & 3;
+@@ -1977,16 +2014,34 @@ int ath_tx_start(struct ieee80211_hw *hw
+               skb_push(skb, padsize);
+               memmove(skb->data, skb->data + padsize, padpos);
+-              hdr = (struct ieee80211_hdr *) skb->data;
+       }
+-      if ((vif && vif->type != NL80211_IFTYPE_AP &&
+-                  vif->type != NL80211_IFTYPE_AP_VLAN) ||
+-          !ieee80211_is_data(hdr->frame_control))
+-              info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
+-
+       setup_frame_info(hw, sta, skb, frmlen);
++      return 0;
++}
++
++/* Upon failure caller should free skb */
++int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
++               struct ath_tx_control *txctl)
++{
++      struct ieee80211_hdr *hdr;
++      struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++      struct ieee80211_sta *sta = txctl->sta;
++      struct ieee80211_vif *vif = info->control.vif;
++      struct ath_softc *sc = hw->priv;
++      struct ath_txq *txq = txctl->txq;
++      struct ath_atx_tid *tid = NULL;
++      struct ath_buf *bf;
++      u8 tidno;
++      int q;
++      int ret;
++
++      ret = ath_tx_prepare(hw, skb, txctl);
++      if (ret)
++          return ret;
++
++      hdr = (struct ieee80211_hdr *) skb->data;
+       /*
+        * At this point, the vif, hw_key and sta pointers in the tx control
+        * info are no longer valid (overwritten by the ath_frame_info data.
+@@ -2002,13 +2057,120 @@ int ath_tx_start(struct ieee80211_hw *hw
                txq->stopped = true;
        }
  
 -      ath_tx_start_dma(sc, skb, txctl);
-+      if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER) {
++      if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
 +              ath_txq_unlock(sc, txq);
 +              txq = sc->tx.uapsdq;
 +              ath_txq_lock(sc, txq);
 +      }
 +
 +      bf->bf_state.bfs_paprd = txctl->paprd;
-+
 +      if (txctl->paprd)
 +              bf->bf_state.bfs_paprd_timestamp = jiffies;
 +
 +      ath_set_rates(vif, sta, bf);
 +      ath_tx_send_normal(sc, txq, tid, skb);
++
 +out:
        ath_txq_unlock(sc, txq);
  
        return 0;
-@@ -2054,7 +2133,12 @@ static void ath_tx_complete(struct ath_s
+ }
++void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
++               struct sk_buff *skb)
++{
++      struct ath_softc *sc = hw->priv;
++      struct ath_tx_control txctl = {
++              .txq = sc->beacon.cabq
++      };
++      struct ath_tx_info info = {};
++      struct ieee80211_hdr *hdr;
++      struct ath_buf *bf_tail = NULL;
++      struct ath_buf *bf;
++      LIST_HEAD(bf_q);
++      int duration = 0;
++      int max_duration;
++
++      max_duration =
++              sc->cur_beacon_conf.beacon_interval * 1000 *
++              sc->cur_beacon_conf.dtim_period / ATH_BCBUF;
++
++      do {
++              struct ath_frame_info *fi = get_frame_info(skb);
++
++              if (ath_tx_prepare(hw, skb, &txctl))
++                      break;
++
++              bf = ath_tx_setup_buffer(sc, txctl.txq, NULL, skb);
++              if (!bf)
++                      break;
++
++              bf->bf_lastbf = bf;
++              ath_set_rates(vif, NULL, bf);
++              ath_buf_set_rate(sc, bf, &info, fi->framelen);
++              duration += info.rates[0].PktDuration;
++              if (bf_tail)
++                      bf_tail->bf_next = bf;
++
++              list_add_tail(&bf->list, &bf_q);
++              bf_tail = bf;
++              skb = NULL;
++
++              if (duration > max_duration)
++                      break;
++
++              skb = ieee80211_get_buffered_bc(hw, vif);
++      } while(skb);
++
++      if (skb)
++              ieee80211_free_txskb(hw, skb);
++
++      if (list_empty(&bf_q))
++              return;
++
++      bf = list_first_entry(&bf_q, struct ath_buf, list);
++      hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
++
++      if (hdr->frame_control & IEEE80211_FCTL_MOREDATA) {
++              hdr->frame_control &= ~IEEE80211_FCTL_MOREDATA;
++              dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
++                      sizeof(*hdr), DMA_TO_DEVICE);
++      }
++
++      ath_txq_lock(sc, txctl.txq);
++      ath_tx_fill_desc(sc, bf, txctl.txq, 0);
++      ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false);
++      TX_STAT_INC(txctl.txq->axq_qnum, queued);
++      ath_txq_unlock(sc, txctl.txq);
++}
++
+ /*****************/
+ /* TX Completion */
+ /*****************/
+@@ -2054,7 +2216,12 @@ static void ath_tx_complete(struct ath_s
        }
        spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
  
        if (txq == sc->tx.txq_map[q]) {
                if (WARN_ON(--txq->pending_frames < 0))
                        txq->pending_frames = 0;
-@@ -2065,8 +2149,6 @@ static void ath_tx_complete(struct ath_s
+@@ -2065,8 +2232,6 @@ static void ath_tx_complete(struct ath_s
                        txq->stopped = false;
                }
        }
  }
  
  static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
-@@ -2408,12 +2490,10 @@ void ath_tx_node_init(struct ath_softc *
+@@ -2408,12 +2573,10 @@ void ath_tx_node_init(struct ath_softc *
                tid->baw_head  = tid->baw_tail = 0;
                tid->sched     = false;
                tid->paused    = false;
        }
  
        for (acno = 0, ac = &an->ac[acno];
-@@ -2450,9 +2530,9 @@ void ath_tx_node_cleanup(struct ath_soft
+@@ -2450,9 +2613,9 @@ void ath_tx_node_cleanup(struct ath_soft
                }
  
                ath_tid_drain(sc, txq, tid);
        /*
 --- a/drivers/net/wireless/ath/ath9k/beacon.c
 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -204,9 +204,15 @@ static struct ath_buf *ath9k_beacon_gene
-       }
+@@ -107,23 +107,6 @@ static void ath9k_beacon_setup(struct at
+       ath9k_hw_set_txdesc(ah, bf->bf_desc, &info);
+ }
+-static void ath9k_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
+-{
+-      struct ath_softc *sc = hw->priv;
+-      struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+-      struct ath_tx_control txctl;
+-
+-      memset(&txctl, 0, sizeof(struct ath_tx_control));
+-      txctl.txq = sc->beacon.cabq;
+-
+-      ath_dbg(common, XMIT, "transmitting CABQ packet, skb: %p\n", skb);
+-
+-      if (ath_tx_start(hw, skb, &txctl) != 0) {
+-              ath_dbg(common, XMIT, "CABQ TX failed\n");
+-              ieee80211_free_txskb(hw, skb);
+-      }
+-}
+-
+ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
+                                            struct ieee80211_vif *vif)
+ {
+@@ -205,10 +188,8 @@ static struct ath_buf *ath9k_beacon_gene
  
        ath9k_beacon_setup(sc, vif, bf, info->control.rates[0].idx);
-+      sc->beacon.cabq_dur = 0;
  
-       while (skb) {
-               ath9k_tx_cabq(hw, skb);
-+
-+              if (sc->beacon.cabq_dur / 1000 - 1 >
-+                  sc->cur_beacon_conf.beacon_interval / ATH_BCBUF)
-+                      break;
-+
-               skb = ieee80211_get_buffered_bc(hw, vif);
-       }
+-      while (skb) {
+-              ath9k_tx_cabq(hw, skb);
+-              skb = ieee80211_get_buffered_bc(hw, vif);
+-      }
++      if (skb)
++              ath_tx_cabq(hw, vif, skb);
  
+       return bf;
+ }
+--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
+@@ -68,13 +68,16 @@
+ #define AR9300_BASE_ADDR 0x3ff
+ #define AR9300_BASE_ADDR_512 0x1ff
+-#define AR9300_OTP_BASE                       (AR_SREV_9340(ah) ? 0x30000 : 0x14000)
+-#define AR9300_OTP_STATUS             (AR_SREV_9340(ah) ? 0x30018 : 0x15f18)
++#define AR9300_OTP_BASE \
++              ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000)
++#define AR9300_OTP_STATUS \
++              ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18)
+ #define AR9300_OTP_STATUS_TYPE                0x7
+ #define AR9300_OTP_STATUS_VALID               0x4
+ #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
+ #define AR9300_OTP_STATUS_SM_BUSY     0x1
+-#define AR9300_OTP_READ_DATA          (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c)
++#define AR9300_OTP_READ_DATA \
++              ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c)
+ enum targetPowerHTRates {
+       HT_TARGET_RATE_0_8_16,