From patchwork Sun Feb 27 22:16:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Yariv X-Patchwork-Id: 593771 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1RMGPsj027005 for ; Sun, 27 Feb 2011 22:16:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751896Ab1B0WQY (ORCPT ); Sun, 27 Feb 2011 17:16:24 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:50372 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743Ab1B0WQY (ORCPT ); Sun, 27 Feb 2011 17:16:24 -0500 Received: by wyg36 with SMTP id 36so3120195wyg.19 for ; Sun, 27 Feb 2011 14:16:22 -0800 (PST) Received: by 10.216.59.143 with SMTP id s15mr1612165wec.49.1298844982816; Sun, 27 Feb 2011 14:16:22 -0800 (PST) Received: from localhost.localdomain (93-173-12-148.bb.netvision.net.il [93.173.12.148]) by mx.google.com with ESMTPS id t5sm1553402wes.9.2011.02.27.14.16.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Feb 2011 14:16:22 -0800 (PST) From: Ido Yariv To: Luciano Coelho Cc: linux-wireless@vger.kernel.org, Ido Yariv , Arik Nemtsov Subject: [PATCH] wl12xx: Remove private headers in wl1271_tx_reset Date: Mon, 28 Feb 2011 00:16:13 +0200 Message-Id: <1298844973-11949-1-git-send-email-ido@wizery.com> X-Mailer: git-send-email 1.7.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 27 Feb 2011 22:16:25 +0000 (UTC) diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index ac60d57..37d354d 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c @@ -687,16 +687,30 @@ void wl1271_tx_reset(struct wl1271 *wl) */ wl1271_handle_tx_low_watermark(wl); - for (i = 0; i < ACX_TX_DESCRIPTORS; i++) - if (wl->tx_frames[i] != NULL) { - skb = wl->tx_frames[i]; - wl1271_free_tx_id(wl, i); - wl1271_debug(DEBUG_TX, "freeing skb 0x%p", skb); - info = IEEE80211_SKB_CB(skb); - info->status.rates[0].idx = -1; - info->status.rates[0].count = 0; - ieee80211_tx_status(wl->hw, skb); + for (i = 0; i < ACX_TX_DESCRIPTORS; i++) { + if (wl->tx_frames[i] == NULL) + continue; + + skb = wl->tx_frames[i]; + wl1271_free_tx_id(wl, i); + wl1271_debug(DEBUG_TX, "freeing skb 0x%p", skb); + + /* Remove private headers before passing the skb to mac80211 */ + info = IEEE80211_SKB_CB(skb); + skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); + if (info->control.hw_key && + info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { + int hdrlen = ieee80211_get_hdrlen_from_skb(skb); + memmove(skb->data + WL1271_TKIP_IV_SPACE, skb->data, + hdrlen); + skb_pull(skb, WL1271_TKIP_IV_SPACE); } + + info->status.rates[0].idx = -1; + info->status.rates[0].count = 0; + + ieee80211_tx_status(wl->hw, skb); + } } #define WL1271_TX_FLUSH_TIMEOUT 500000