]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
p54: Fix for TX sequence number problem
authorLarry Finger <Larry.Finger@lwfinger.net>
Tue, 5 Aug 2008 16:23:16 +0000 (11:23 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 7 Aug 2008 13:49:04 +0000 (09:49 -0400)
Following "mac80211: fix TX sequence numbers", if a packet
has the IEEE80211_TX_CTL_ASSIGN_SEQ assigned, a sequence number must be
supplied, either by hardware or software. AFAIK, no such hardware exists
for the p54, thus it must be done in software. With this patch, a connection
qith p54usb is stable, whereas the interface went off-line in 2-3 hours
without this change. Note that this code will have to be reworked for proper
sequence numbers on beacons. In addition, the sequence number has been placed
in the hardware state, not the vif state.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/p54/p54.h
drivers/net/wireless/p54/p54common.c

index cac9a515b82d5117bb56524502ca0f619f3d21cb..4801a363507bfae7922bae530554c5de040c2e5b 100644 (file)
@@ -52,6 +52,7 @@ struct p54_common {
        int (*open)(struct ieee80211_hw *dev);
        void (*stop)(struct ieee80211_hw *dev);
        int mode;
+       u16 seqno;
        struct mutex conf_mutex;
        u8 mac_addr[ETH_ALEN];
        u8 bssid[ETH_ALEN];
index 4da89ea9b561d5265c93dc764a68f9a473844750..2d2d33612aef48a6bea84c0021a627d0e8526f06 100644 (file)
@@ -553,6 +553,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
        struct ieee80211_tx_queue_stats *current_queue;
        struct p54_common *priv = dev->priv;
        struct p54_control_hdr *hdr;
+       struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data;
        struct p54_tx_control_allocdata *txhdr;
        size_t padding, len;
        u8 rate;
@@ -605,6 +606,19 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
        if (padding)
                txhdr->align[0] = padding;
 
+       /* FIXME: The sequence that follows is needed for this driver to
+        * work with mac80211 since "mac80211: fix TX sequence numbers".
+        * As with the temporary code in rt2x00, changes will be needed
+        * to get proper sequence numbers on beacons. In addition, this
+        * patch places the sequence number in the hardware state, which
+        * limits us to a single virtual state.
+        */
+       if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+               if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+                       priv->seqno += 0x10;
+               ieee80211hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+               ieee80211hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
+       }
        /* modifies skb->cb and with it info, so must be last! */
        p54_assign_address(dev, skb, hdr, skb->len);