Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[pandora-kernel.git] / drivers / net / wireless / ath / ath5k / base.c
index 28113e0..dce848f 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <linux/module.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/hardirq.h>
 #include <linux/if.h>
 #include <linux/io.h>
@@ -531,7 +532,7 @@ ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
        if (iter_data.n_stas > 1) {
                /* If you have multiple STA interfaces connected to
                 * different APs, ARPs are not received (most of the time?)
-                * Enabling PROMISC appears to fix that probem.
+                * Enabling PROMISC appears to fix that problem.
                 */
                sc->filter_flags |= AR5K_RX_FILTER_PROM;
        }
@@ -1349,7 +1350,7 @@ ath5k_receive_frame(struct ath5k_softc *sc, struct sk_buff *skb,
         * timestamp (beginning of phy frame, data frame, end of rx?).
         * The only thing we know is that it is hardware specific...
         * On AR5213 it seems the rx timestamp is at the end of the
-        * frame, but i'm not sure.
+        * frame, but I'm not sure.
         *
         * NOTE: mac80211 defines mactime at the beginning of the first
         * data symbol. Since we don't have any time references it's
@@ -1554,7 +1555,8 @@ ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
                goto drop_packet;
        }
 
-       if (txq->txq_len >= txq->txq_max)
+       if (txq->txq_len >= txq->txq_max &&
+           txq->qnum <= AR5K_TX_QUEUE_ID_DATA_MAX)
                ieee80211_stop_queue(hw, txq->qnum);
 
        spin_lock_irqsave(&sc->txbuflock, flags);
@@ -1764,7 +1766,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
         * 4 beacons to make sure everybody hears our AP.
         * When a client tries to associate, hw will keep
         * track of the tx antenna to be used for this client
-        * automaticaly, based on ACKed packets.
+        * automatically, based on ACKed packets.
         *
         * Note: AP still listens and transmits RTS on the
         * default antenna which is supposed to be an omni.
@@ -1930,6 +1932,10 @@ ath5k_beacon_send(struct ath5k_softc *sc)
        skb = ieee80211_get_buffered_bc(sc->hw, vif);
        while (skb) {
                ath5k_tx_queue(sc->hw, skb, sc->cabq);
+
+               if (sc->cabq->txq_len >= sc->cabq->txq_max)
+                       break;
+
                skb = ieee80211_get_buffered_bc(sc->hw, vif);
        }
 
@@ -2099,11 +2105,11 @@ static void ath5k_tasklet_beacon(unsigned long data)
         *
         * In IBSS mode we use this interrupt just to
         * keep track of the next TBTT (target beacon
-        * transmission time) in order to detect wether
+        * transmission time) in order to detect whether
         * automatic TSF updates happened.
         */
        if (sc->opmode == NL80211_IFTYPE_ADHOC) {
-               /* XXX: only if VEOL suppported */
+               /* XXX: only if VEOL supported */
                u64 tsf = ath5k_hw_get_tsf64(sc->ah);
                sc->nexttbtt += sc->bintval;
                ATH5K_DBG(sc, ATH5K_DEBUG_BEACON,
@@ -2420,6 +2426,7 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops)
        common->ah = sc->ah;
        common->hw = hw;
        common->priv = sc;
+       common->clockrate = 40;
 
        /*
         * Cache line size is used to size and align various
@@ -2466,7 +2473,7 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops)
                                                sc->ah->ah_radio_5ghz_revision),
                                                sc->ah->ah_radio_5ghz_revision);
                        /* No 2GHz support (5110 and some
-                        * 5Ghz only cards) -> report 5Ghz radio */
+                        * 5GHz only cards) -> report 5GHz radio */
                        } else if (!test_bit(AR5K_MODE_11B,
                                sc->ah->ah_capabilities.cap_mode)) {
                                ATH5K_INFO(sc, "RF%s 5GHz radio found (0x%x)\n",
@@ -2724,7 +2731,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
 
        ath5k_ani_init(ah, ani_mode);
 
-       ah->ah_cal_next_full = jiffies;
+       ah->ah_cal_next_full = jiffies + msecs_to_jiffies(100);
        ah->ah_cal_next_ani = jiffies;
        ah->ah_cal_next_nf = jiffies;
        ewma_init(&ah->ah_beacon_rssi_avg, 1024, 8);
@@ -2796,7 +2803,7 @@ ath5k_init(struct ieee80211_hw *hw)
 
        /*
         * Collect the channel list.  The 802.11 layer
-        * is resposible for filtering this list based
+        * is responsible for filtering this list based
         * on settings like the phy mode and regulatory
         * domain restrictions.
         */