From patchwork Fri Feb 4 06:23:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Natarajan X-Patchwork-Id: 531141 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 p146OWM7032173 for ; Fri, 4 Feb 2011 06:24:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751784Ab1BDGYJ (ORCPT ); Fri, 4 Feb 2011 01:24:09 -0500 Received: from mail.atheros.com ([12.19.149.2]:57256 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790Ab1BDGYH (ORCPT ); Fri, 4 Feb 2011 01:24:07 -0500 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Thu, 03 Feb 2011 22:23:47 -0800 Received: from smtp.atheros.com (10.12.4.8) by SC1EXHC-01.global.atheros.com (10.10.20.111) with Microsoft SMTP Server (TLS) id 8.2.213.0; Thu, 3 Feb 2011 22:24:05 -0800 Received: by smtp.atheros.com (sSMTP sendmail emulation); Fri, 04 Feb 2011 11:54:00 +0530 From: Vivek Natarajan To: CC: Subject: [PATCH 1/2] ath9k: Drain txq before sending a nullfunc frame. Date: Fri, 4 Feb 2011 11:53:59 +0530 Message-ID: <1296800640-6381-1-git-send-email-vnatarajan@atheros.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 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]); Fri, 04 Feb 2011 06:24:33 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 68a1c76..0cb6017 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1710,7 +1710,6 @@ static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw, bf->bf_buf_addr, txq->axq_qnum); - return bf; } @@ -1813,6 +1812,15 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, if (unlikely(!bf)) return -ENOMEM; + if (ieee80211_is_nullfunc(hdr->frame_control) && + ieee80211_has_pm(hdr->frame_control)) { + /* Drain all the pending frames before we send a nullfunc frame + * to avoid any power save state mismatch between the station + * and the AP. + */ + ath_drain_all_txq(sc, false); + } + q = skb_get_queue_mapping(skb); spin_lock_bh(&txq->axq_lock); if (txq == sc->tx.txq_map[q] &&