]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ath9k: Assign seq# when mac80211 requests this
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 11 Aug 2008 11:01:50 +0000 (14:01 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 11 Sep 2008 15:10:28 +0000 (11:10 -0400)
Use TX control flag IEEE80211_TX_CTL_ASSIGN_SEQ as a request to update
the seq# for the frames. This will likely require some further cleanup
to get seq# correctly for Beacons vs. other frames and also potentially
for multiple BSSes. Anyway, this is better than ending up sending out
most frames with seq# 0.

(This is a backport of patch w/ same title already in net-next-2.6.
It is verified to fix http://bugzilla.kernel.org/show_bug.cgi?id=11394
and it should be acceptable for -rc due to the driver being new
in 2.6.27.)

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/beacon.c
drivers/net/wireless/ath9k/core.h
drivers/net/wireless/ath9k/main.c

index caf569401a34452b97577517b6b8f5fb09a24903..00a0eaa0886661e08735b76db242304b65ae7092 100644 (file)
@@ -209,6 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
        unsigned int curlen;
        struct ath_txq *cabq;
        struct ath_txq *mcastq;
+       struct ieee80211_tx_info *info;
        avp = sc->sc_vaps[if_id];
 
        mcastq = &avp->av_mcastq;
@@ -232,6 +233,18 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
         */
        curlen = skb->len;
 
+       info = IEEE80211_SKB_CB(skb);
+       if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+               /*
+                * TODO: make sure the seq# gets assigned properly (vs. other
+                * TX frames)
+                */
+               struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+               sc->seq_no += 0x10;
+               hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+               hdr->seq_ctrl |= cpu_to_le16(sc->seq_no);
+       }
+
        /* XXX: spin_lock_bh should not be used here, but sparse bitches
         * otherwise. We should fix sparse :) */
        spin_lock_bh(&mcastq->axq_lock);
index 673b3d81133a3cb841372cf0ea93ca866bb5fd8b..4ee695b76b88ece8e9ac4de86576555a737f0168 100644 (file)
@@ -992,6 +992,7 @@ struct ath_softc {
        u32 sc_txintrperiod;    /* tx interrupt batching */
        int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */
        u32 sc_ant_tx[8];       /* recent tx frames/antenna */
+       u16 seq_no; /* TX sequence number */
 
        /* Beacon */
        struct ath9k_tx_queue_info sc_beacon_qi;
index c5107f269f24f2e250563814e800cdccad725538..99badf1404c31a0fbb9640137cf5d1c36f212d28 100644 (file)
@@ -369,6 +369,20 @@ static int ath9k_tx(struct ieee80211_hw *hw,
 {
        struct ath_softc *sc = hw->priv;
        int hdrlen, padsize;
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+
+       /*
+        * As a temporary workaround, assign seq# here; this will likely need
+        * to be cleaned up to work better with Beacon transmission and virtual
+        * BSSes.
+        */
+       if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+               struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+               if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+                       sc->seq_no += 0x10;
+               hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+               hdr->seq_ctrl |= cpu_to_le16(sc->seq_no);
+       }
 
        /* Add the padding after the header if this is not already done */
        hdrlen = ieee80211_get_hdrlen_from_skb(skb);