ath9k: Cleanup return values
[safe/jmp/linux-2.6] / drivers / net / wireless / ath / ath9k / xmit.c
index 24663ce..2c01fda 100644 (file)
@@ -382,8 +382,24 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
                                struct ath_buf *tbf;
 
                                tbf = ath_clone_txbuf(sc, bf_last);
-                               if (!tbf)
+                               /*
+                                * Update tx baw and complete the frame with
+                                * failed status if we run out of tx buf
+                                */
+                               if (!tbf) {
+                                       spin_lock_bh(&txq->axq_lock);
+                                       ath_tx_update_baw(sc, tid,
+                                                         bf->bf_seqno);
+                                       spin_unlock_bh(&txq->axq_lock);
+
+                                       bf->bf_state.bf_type |= BUF_XRETRY;
+                                       ath_tx_rc_status(bf, ds, nbad,
+                                                        0, false);
+                                       ath_tx_complete_buf(sc, bf, &bf_head,
+                                                           0, 0);
                                        break;
+                               }
+
                                ath9k_hw_cleartxdesc(sc->sc_ah, tbf->bf_desc);
                                list_add_tail(&tbf->list, &bf_head);
                        } else {
@@ -679,25 +695,20 @@ static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq,
                 status != ATH_AGGR_BAW_CLOSED);
 }
 
-int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
-                     u16 tid, u16 *ssn)
+void ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
+                      u16 tid, u16 *ssn)
 {
        struct ath_atx_tid *txtid;
        struct ath_node *an;
 
        an = (struct ath_node *)sta->drv_priv;
-
-       if (sc->sc_flags & SC_OP_TXAGGR) {
-               txtid = ATH_AN_2_TID(an, tid);
-               txtid->state |= AGGR_ADDBA_PROGRESS;
-               ath_tx_pause_tid(sc, txtid);
-               *ssn = txtid->seq_start;
-       }
-
-       return 0;
+       txtid = ATH_AN_2_TID(an, tid);
+       txtid->state |= AGGR_ADDBA_PROGRESS;
+       ath_tx_pause_tid(sc, txtid);
+       *ssn = txtid->seq_start;
 }
 
-int ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
+void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
 {
        struct ath_node *an = (struct ath_node *)sta->drv_priv;
        struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid);
@@ -707,11 +718,11 @@ int ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
        INIT_LIST_HEAD(&bf_head);
 
        if (txtid->state & AGGR_CLEANUP)
-               return 0;
+               return;
 
        if (!(txtid->state & AGGR_ADDBA_COMPLETE)) {
                txtid->state &= ~AGGR_ADDBA_PROGRESS;
-               return 0;
+               return;
        }
 
        ath_tx_pause_tid(sc, txtid);
@@ -740,8 +751,6 @@ int ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
                txtid->state &= ~AGGR_ADDBA_COMPLETE;
                ath_tx_flush_tid(sc, txtid);
        }
-
-       return 0;
 }
 
 void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
@@ -2021,7 +2030,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
        }
 }
 
-void ath_tx_complete_poll_work(struct work_struct *work)
+static void ath_tx_complete_poll_work(struct work_struct *work)
 {
        struct ath_softc *sc = container_of(work, struct ath_softc,
                        tx_complete_work.work);